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

Add Serial no in crystal report without coding

File operations in C# (.net)

SQL – Generate decimal numbers sequence for particular number range