I need to insert data from a sql script into a table. The query has multi select statements and declare and can have any sql statement. Simply I need to take the sql script from a user and insert into a table.
Example of input query:
declare @variable1 int = 1
select * into #temp
from table1
where column1 = @variable1
select * from #temp
except
select * from table2