Riverman1111
Programmer
Hi,
I have a need to create a stored procedure that has 3 input parameters which are to be used as select criteria against a table. Each of the 3 parameters can either be specific values, or 'all'.
if parm a = 1, b = 2, and c='all' the query would be:
select * from table
where (a like 1 and b like 2 and c like '%%')
Is there a way to create dynamic sql in a stored procedure?
Thanks!
I have a need to create a stored procedure that has 3 input parameters which are to be used as select criteria against a table. Each of the 3 parameters can either be specific values, or 'all'.
if parm a = 1, b = 2, and c='all' the query would be:
select * from table
where (a like 1 and b like 2 and c like '%%')
Is there a way to create dynamic sql in a stored procedure?
Thanks!