What the difference between
INSERT INTO table VALUES (values)
and
INSERT OVER table VALUES (values)
?
What the difference between
INSERT INTO table VALUES (values)
and
INSERT OVER table VALUES (values)
?
Of all reserved keywords, only INTO
and OVER
work.
SQL:2003
mentions OVERRIDING
keyword to override the identity (currently only supported by DB2
)
Probably, SQL Server
parses it for now but does not actually implement.
The plans generated are identical, and ParameterizedText
is expanded into INSERT INTO
.
So as for 2008R2
, the answer would be this:
No difference, except that INSERT OVER
has already wasted about 50 manhours of most curious developers to the moment and there is more to go
People at Microsoft say:
Thanks for reporting this issue. We keep recognizing the OVER keyword along with the INTO keyword (with the same meaning) in INSERT statements to provide backward compatibility with the previous versions of SQL Server. This should not present any problem for application development.
Eugene Zabokritski, SQL Engine
According to this page:
http://msdn.microsoft.com/en-us/library/ms174335.aspx
INSERT OVER is not part of the defined syntax tree. Therefore, even if it works, it's probably not officially supported by Microsoft.
Apologies for resurrecting a dead thread, but this shows near the top of a Google search for INSERT OVER. I was hoping to find a better explanation/example here, but this link does a decent job as a starting point. If you're looking for information on the INSERT OVER DML statement (like a Merge command), take a look at this link: https://decipherinfosys.wordpress.com/2007/11/28/sql-server-2008-insert-over-a-dml-statement/
Presumably INSERT OVER
is supposed to overwrite an existing row in the table. For this you would actually use
UPDATE <table> SET <field=value, field2=value2> WHERE <condition to pinpoint row>