I already have values in a temp table and I want to insert it into my table.
I follow this syntax
IF NOT EXISTS (SELECT 1 FROM ABC abc JOIN #Temp t ON abc.ID = t.ID)
insert into MyTable(Id,Name)
select values (t.ID, t.Name)
From t
I have just the name t as an alias I created in a condition before this insert.
Is this correct? Some people use @ etc. I am confused.
Correct syntax:
insert into MyTable(Id,Name)
select t.ID, t.Name
From #temp t
Always read manual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With