troubleshooting Question

When declaring a parameter in SQL Can you set the parameter to use all records that contain the word...

Avatar of RUA Volunteer2?
RUA Volunteer2?Flag for United States of America asked on
Microsoft SQL ServerSQL
3 Comments1 Solution20 ViewsLast Modified:
When declaring a parameter in SQL Can you set the parameter to use all records that contain the words like this '%Test%' or '%Experiment%' or '%Study%' so as an example can you do this?
   ALTER procedure [dbo].[bi_medica_code_combo]
        @med_code  ........... varchar(max) like  '%Test%' or '%Experiment%' or '%Study%'

Can you apply any record that contains those 3 values through to the parameter to run EXEC on the [bi_medica_code_combo]  procedure. If so I really need the proper format to make this work.
      @med_code  ........... varchar(max) like  '%Test%' or '%Experiment%' or '%Study%'
or
      @med_code  ........... varchar(max) "in" or "=" ... ('%Test%' , '%Experiment%' , '%Study%')

If I have to put the exact value like "Test1,Test2,Test3...Test100" to pass to the parameter and I cannot use some kind of '%...%' please let me know. 
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros