I want to write a SQL Server 2005 stored procedure which will select and return the user records from the user table for some userids which are passed to the stored procedur
try this this works for me
DECLARE @InClause NVARCHAR(100) SET @InClause = 'tom,dick,harry' DECLARE @SafeInClause NVARCHAR(100) SET @SafeInClause = ',' + @InClause + ',' SELECT * FROM myTable WHERE PATINDEX(',' + myColumn + ',', @SafeInClause) > 0