NewTerminator
Programmer
I have an sql statment that looks like the one below:
declare @IDs varchar(100)
set @IDs = '''113''' + ',' + '''115'''
select *
from Student
where convert(varchar(30),cid) in (@IDs)
the cid column is of type int. print @IDs returns me '113','115', but i am still not able to retrieve records. Manually giving the numbers in the in clause returns records.
What is wrong in this statment.
Any help would be appreciated.
declare @IDs varchar(100)
set @IDs = '''113''' + ',' + '''115'''
select *
from Student
where convert(varchar(30),cid) in (@IDs)
the cid column is of type int. print @IDs returns me '113','115', but i am still not able to retrieve records. Manually giving the numbers in the in clause returns records.
What is wrong in this statment.
Any help would be appreciated.