I have a really simple query, for the sake of argument, let's say it looks exactly like this:
Ok, if I run that query in SQL Query Analyzer, it works perfectly fine, but as a stored procedure where "1,2,3,4" is a value that is passed to SQL I can't get it to work.
I get the following error:
The obvious answer is in the data type, but if that's the case, why can I write it as a regular query and get the right answer? Kevin
slanek@ssd.fsi.com
Code:
SELECT *
FROM myTable
WHERE myValue IN (1,2,3,4)
Code:
SELECT *
FROM myTable
WHERE myValue IN (@variable)
Code:
Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '1,2,3,4' to a column of data type int.
slanek@ssd.fsi.com