Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between insert statement with into and without into?

I have created table #temp with columns id as int identity(1,1) and name as varchar.

Say suppose I am writing the following 2 different statements for inserting rows:

insert into #temp (name) select ('Vikrant') ;   

insert #temp (name) select ('Vikrant')

I want to ask what is the difference between these two types of insert statements?
Is there really any difference in between these insertions?

like image 338
Vikrant More Avatar asked Feb 23 '23 13:02

Vikrant More


1 Answers

From the MSDN documentation:

[INTO] Is an optional keyword that can be used between INSERT and the target table.

There is no difference between the two statements.

like image 85
RB. Avatar answered Feb 25 '23 05:02

RB.