Try another statement for inserting the data:
select col1, col2
into #Inter2
from . . .
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All,
Not sure what is wrong with this SQL , I am getting an Invalid Object Name error
If Object_Id('tempdb.dbo.#Inter2') is not null Drop Table #Inter2
Insert Into #Inter2
select col1,col2
select * from #Inter2
I get Invalid Object name '#Inter2'. Please advice
Thanks
Try another statement for inserting the data:
select col1, col2
into #Inter2
from . . .
Hi @BKAN ,
Do you want to copy data from a table and then insert the data into an existing table?
If so, you can try the following code:
INSERT INTO new_tablename
(column_name(s))
SELECT column_name(s)
FROM old_tablename;
Best regards
Niko
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".