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

SQL – Generate decimal numbers sequence for particular number range

File operations in C# (.net)

Ways to SELECT XML string using Nodes and OPENXML()