incorrect syntax near '@p1'
Hi, I have a sp in execute SQL task,where it is updating one table based on the input values(most of them are boolean).There are total 9 input parameters,out of those 8 are boolean.But in parameter mapping since boolean is not present,I have given as 'LONG' .The sp is executing fine in SQL server.When I am running through BIDS,getting below error.Please help me on this . [Execute SQL Task] Error: Executing the query "exec usp_UpdateFile ?,?,?,?,?,?,?,?,?" failed with the following error: "Incorrect syntax near '@P1'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
November 19th, 2012 7:01am

Your parameter type for boolean should be VARIANT_BOOL
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2012 7:24am

I tried it.But again getting same error.
November 19th, 2012 7:42am

Possible reason might be 1) Parameter mapping might be wrong 2) the variable is assigned with null value Please try puting break point on at execute sql task and check the value of variables Thanks, Vipin
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2012 8:57am

I tried giving it as in DB and in task with single quote.If I execute the task with hardcoded values(eg . exec [dbo].[exec usp_UpdateFile] '0','0','0','0','0','0','0','0','1'),it is sucessfully completing.But when I replaced this numbers with question mark,I am getting different error now. exec [dbo].[exec usp_UpdateFile] '?','?','?','?','?','?','?','?','?' [Execute SQL Task] Error: Executing the query "exec [dbo].[usp_UpdateFile] '?','?','?','?','?','?','?','?','?'" failed with the following error: "Error converting data type varchar to bit.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. Please guide me,if you have come across similar incidents.
November 19th, 2012 9:01am

You can't place ? inside single quotes ' '. put your expression like below :- exec [dbo].[exec usp_UpdateFile] ?,?,?,?,?,?,?,?,? Map your parameters mapping you will not get error. jeevesh fuloria
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2012 10:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics