RUA Volunteer2?
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.
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ALTER procedure [dbo].[bi_medica_code_combo]
(
@start_date.......date = '20210501'
@end_date........date = '20210601'
@med_code.......varchar(max) = (are you saying to put all you posted above my existing query or part of it?)
@insur_code......varchar(max) like ('%Blue%','%United%',''%Humana%') This line is formatted incorrectly to.
)
I have all my select from where and order by query below this declare section of the SQL?