parameterize a query containing an IN clause with a variable number of arguments

Try following query

select * from [TestApp].[dbo].[Info]
where '|pune      |SDF       |sfd       |dgd       |'
like '%|' + adds + '|%'


Result :

f_name    adds           city           state            id             zip
nihar        pune          pune          mah           1             23232    
FSDF       SDF           SFS           SF            SDF           S        
sf             sfd           sfs           sfd                fsf           sfds     
sf             sfd           sfs           sfd                fsf           sfds     
gddg         dgd           dgd           dg               dtge          dgf      
gddg         dgd           dgd           dg               dtge          dgf      










Comments

Popular posts from this blog

File operations in C# (.net)

Add Serial no in crystal report without coding

How to get top " n " number of rows from table