Hello SQL Expert,
I am trying to create a dynamic SQL from below simple query so it can handle end user multiple values of a parameter called job ID which is a SUBSTRING from JobID column.
So here is my simple query
Declare @Job varchar(max)
Set @Job = '216'
Where substring(JobNo,1,3) in (@Job)
Example of the JobID values are: 216AADD5, 364EED8, 654TTRD0, and so on. So, we are using the first 3 digit as our JobNo parameter.
With the current above query, end user only able to run one value at one execution and we are trying to let the end users to select more than one values like for example: 216,364 and 654 and so on. I know using the Dynamic SQL will take of this but I am not sure how to do it. Anyone?