Avatar of RUA Volunteer2?
RUA Volunteer2?
Flag for United States of America

asked on 

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

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. 
SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
Andrei Fomitchev

8/22/2022 - Mon