question

jackstraw22 avatar image
jackstraw22 asked

How to put multiple string values in one parameter

I have a table of text status codes. I need to create a parameter that would join some of these codes into one, such as a parameter that would contain all statuses that begin with the letters "O" and "R". How would you create something like this?
parameters
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can you give us a mocked up example of what you are trying to achieve? Your request seems a little ambiguous (or maybe my coffee hasn't taken effect yet). Are you looking at using a function or stored procedure to apply parameters?
1 Like 1 ·
And which version of SQL are you on?
0 Likes 0 ·

1 Answer

· Write an Answer
jackstraw22 avatar image
jackstraw22 answered
I'm looking at using a function and I'm using SQL 2014. The current parameter looks something like this: AND @ClaimStatus = HT.ClaimStatus) I need to declare @ClaimStatus to do something like "@ClaimStatus in ('O%' or 'R%') so that it will already be populated with all statuses beginning with "O" or "R."
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.