Error in SQL Server 2005 with passing a variable

Tags:
SQL Server 2005
SQL Server errors
SQL Server Variables
T-SQL
In T-SQL code on SQL Server 2005, the variable :t_id is being passed from other pages and works in other statements, but it is not parsing within this statement: define("TF_T_INFO_INSERET", " insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select max(TF_ID) from LU_TF); "); If I replace :t_id with a number, it works fine. I tried declaring a new variable and passing it to the statement, and I get this same error: An error was encountered while saving: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error (SQLExecute[0] at extpdo_odbcodbc_stmt.c:133) Any idea what is going on?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following