Further Note. I have found and tried nthe workaround in SQLDTS article 234.
Dosent bwork for me. As soon as I add the ? to the diconnected edit of the
sql statement in the task I get:
The task reported failure on execution. Invalid character value for cast
specification. Syntax oe Access Violation.
[quoted text, click to view] "Jinx1966" wrote:
> I have an issue where I cannot use input parameters in an Execute SQL task. I
> can write any query which will hold values or other variables eg @LogRecID =
> 23 or @LogRecID = @AnotherVariable, and when I hit the parse button the
> syntax is fine. Indeed I can cut and paste it into query analyser and the
> code works fine. BUT as soon as I put a ? place marker in the query then I
> get the error in a pop up:
> Error Source : Microsoft OLE DB Provider for SQL Server
> Error Description: Syntax Error or access Voilation
>
> I have checked permissions on the server and the tables, views and SPs
> involved. I have tried running the whole thing as 'sa' both from a
> workstation and on the server directly. Always the same error. I have also
> updated from MDAC 2.7 to 2.8, with no effect.
> When I press the parameters button I get the same error, howerver this time
> it is followed by the message: An error occured whise parsing the SQL
> Statement for parameters. Please check the sytax of the SQL Statement and
> verify that it is valid for the connection selected. I know the sytax and
> varaible definitions are fine because if I replace the ? with a value or
> another variable the pasre button validates ok!
>
> This is driving me bonkers. Please help
>
> Regards Jinx1966