SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 parametrized query help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nextaxtion
Starting Member

India
30 Posts

Posted - 09/14/2013 :  03:34:29  Show Profile  Reply with Quote
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
Constraint Violating Yak Guru

323 Posts

Posted - 09/14/2013 :  07:01:22  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000