[ACCEPTED]-SQL Server Insert Without INTO-insert
The INTO is optional. It is required in ANSI sql but 2 the MS/Sybase developers decided to make 1 it optional.
Check the BNF grammar http://savage.net.au/SQL/
92, 99, SQL:2003
<insert statement> ::= INSERT INTO <insertion target> <insert columns and source>
According 5 to the ANSI spec, INTO should only be optional 4 in a MERGE
clause.
For SQL Server (this link from 2000 to 3 show how old it is - it exists from the 2 first version of SQL Server), it is optional. It 1 is also optional for MySQL.
INSERT [ INTO]
{ table_name WITH ( < table_hint_limited > [ ...n ] )
| view_name
| rowset_function_limited
}
{ [ ( column_list ) ]
{ VALUES
( { DEFAULT | NULL | expression } [ ,...n] )
| derived_table
| execute_statement
}
}
| DEFAULT VALUES
From MSDN:
INTO is an optional keyword that 1 can be used between INSERT and the target table.
http://msdn.microsoft.com/en-us/library/aa933206%28v=sql.80%29.aspx
You mention that this comes from an early 2 version of SQL. If you have 2005 onwards 1 running now you can drop the INTO.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.