im passing one input parameter to the SP, based on that parameter i have written the code like below
create procedure SP1(@inpName varchar(10))
declare @where varchar(20);if @inpName = 'ABCD' @where = 'A';else if @inpName = '1234' @where = '1';else if @inpName = 'AB12' @where = 'A,B';
SELECT * FROM TABLE1 WHERE COLUMN1 IN(@where);
Now the above query was fine if its 'ABCD' or '1234', but if its 'AB12' then query failed.How to resolve this issue.?
View Complete Post