SQL Server incorrectly accepts prefixes in column list of INSERT statements - by Erland Sommarskog

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 311881 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/22/2007 2:06:47 PM
Access Restriction Public


If you add a prefix to a column in an INSERT list, SQL Server gladly accepts this,
although the prefix makes no sense.

Fixing this could potentially break existing code, so if this is addressed in SQL 2008,
it seems a good idea to permit it in compatibility mode 90.

At very least, the syntax should be deprecated.

I've tried this in SQL 2000, SQL 2005 and SQL 2008 and approve it.
Sign in to post a comment.
Posted by Erland Sommarskog on 8/10/2008 at 12:09 PM
This was close as fixed, but since the syntax is accepted in SQL 2008 RTM
in compat mode 100, I repoen it. I did not even get a deprecation event in Profiler.
Posted by Michael [MSFT] on 3/5/2008 at 6:50 PM
Hi Erland

As an update: We are planning on restricting the column names to simple column names as defined in the SQL-2006 standard for the MERGE statement and are considering to put the fully qualified names for column names for the normal INSERT statement on the deprecation path in the next release.

Thanks for your report. I will leave this comment open until we have finalized our deprecation approach.

Best regards
Posted by Jim [MSFT] on 1/17/2008 at 12:38 PM

Thankyou for this bug report. The language parser skips over the prefix and ends up doing "the right thing"; but detecting and explicity rejecting that extra token would improve useability.

The bug is now assigned to the Development Team to fix.