I am just wondering if it is possible to use a variable within a stored procedure. For Example:
CASE @productType
WHEN 1 THEN
DECLARE @table = ‘products1’
WHEN 2 THEN
DECLARE @table = ‘products2’
END
SELECT * FROM @table;
Obviously this does not work, just wondering if there is a way to accomplish this.