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
 Development Tools
 Reporting Services Development
 using LIKE on a multi value parameter?

Author  Topic 

blodzoom
Starting Member

28 Posts

Posted - 2015-02-27 : 17:26:22
Is it possible to say

WHERE table.field LIKE ('%x%','%y%','%z%')

I realize this syntax is completely wrong but I'm wondering if there is some mechanism to achieve this.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-27 : 17:47:47
WHERE table.field LIKE'%x%y%z%'

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

blodzoom
Starting Member

28 Posts

Posted - 2015-02-27 : 17:52:01
How can I write that if x, y and z are the values in a multi-value parameter?

WHERE table.field INLIKE (@parameter) is what I really want
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-27 : 17:57:21
You'll need to use a CSV function. There are many available if you google it.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -