How to ignore a SQL parameter if it is to be left blank
Posted on 2014-04-29
I have a SQL Stored Proc and I have various parameters I pass into it, including one named @StockNbr.
I have a WHERE condition in the Stored Proc as follows:
WHERE LEFT(stk_nbr,1) IN (SELECT item Common.StrToTable(@StockNbr,100))
How do I modify the Stored Proc to ignore the @StockNbr parameter if I do not wany to pass-in a value for it?