Dynamic SQL Comma-Delimited Value Query
问题 [Update: Using SQL Server 2005] Hi, what I want to do is query my stored procedure with a comma-delimited list of values (ids) to retrieve rows of data. The problem I am receiving is a conversion error: Conversion failed when converting the varchar value ' + @PassedInIDs + ' to data type int. The statement in my where-clause and error is: ... AND (database.ID IN (' + @PassedInIDs + ')) Note: database.ID is of int type. I was following the article at: http://www.sql-server-helper.com/functions