sqlsql-servert-sqlsql-insert

INSERT vs INSERT INTO


I have been working with T-SQL in SQL Server for some time now and somehow whenever I have to insert data into a table I tend to use syntax:

INSERT INTO myTable <something here>

I understand that keyword INTO is optional here and I do not have to use it but somehow it grew into habit in my case.

My question is:


Solution

  • INSERT INTO is the standard. Even though INTO is optional in most implementations, it's required in a few, so it's a good idea to include it if you want your code to be portable.

    You can find links to several versions of the SQL standard here. I found an HTML version of an older standard here.