I have a query and as part of the Where clause I want to see if the string OrgCode is contained in a list of strings that get passed in as a parameter @OrgCodeList.
For for example, what I want to do (but doesn't work) is
where OrgCode in (@OrgCodeList).
OrgCodeList is something like ('ABCD','EFGH','IJKL')
I obtained this code, which works but is very slow.
where @OrgCodeList like '%' + OrgCode + '%'
Can anyone tell me how I might get this to run faster?