I want to store the results into table with same name as per the condition. How to achieve the same ? Following is the code: While executing it throws error that #a already exists.
IF @Input ='1'
BEGIN
drop #a
SELECT *
INTO #a
FROM table1
END;
ELSE IF @Input ='2'
BEGIN
drop #a
SELECT *
INTO #a
FROM table2
END;