I am trying to execute two select statements into a query that pumps data into a temp table. The first query will have 5 columns while the second query will have only one column.
The first can be achieved by:
Select a.ID AS [a],
b.ID AS [b],
c.ID AS [c]
Select z.ID AS [c]
There is already an object named #testingTemp in the database
Change it into a insert into statement. Otherwise you create the same temp table multiple times and that is not allowed.
Insert into #testingTemp (a,b,c) Select a.ID AS [a], b.ID AS [b], c.ID AS [c] FROM