Home Forums SQL Server 7,2000 T-SQL Using variables within IN RE: Using variables within IN
David Burrows
SSC Guru
Points: 65111
More actions
June 11, 2003 at 6:16 am
#460736
DECLARE @SomeVariable varchar(10)
SET @SomeVariable = '1,2,5'
SELECT * FROM TableA WHERE CHARINDEX(CAST(ColumnB as varchar),','+@SomeVariable+',') > 0
Far away is close at hand in the images of elsewhere. Anon.