Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 parametrized query help

Author  Topic 

nextaxtion
Yak Posting Veteran

54 Posts

Posted - 2013-09-14 : 03:34:29
declare @vid varchar(1000) = '1000000116 ,1000000117 '
select * from qt_branch
where cast(branch as varchar(max)) in (@vid)

Pls help in this

prithvi nath pandey

bitsmed
Aged Yak Warrior

545 Posts

Posted - 2013-09-14 : 07:01:22
Try this:

declare @vid varchar(1000)='1000000116,1000000117'
select *
from qt_branch
where ','+@vid like '%,'+cast(branch as varchar(max))+',%'
Go to Top of Page
   

- Advertisement -