The information in this article applies to:
SUMMARY
When working with a table alias (a "correlation name" in ANSI terminology),
the syntax checking in Microsoft SQL Server 6.0 has changed to comply with
the ANSI specification. ANSI states,
A <table name> ... is exposed ... if and only if the <table reference> does not specify a <correlation name>. In previous versions of Microsoft SQL Server, you could qualify columns of a table by using either the table name or a table alias. In SQL Server 6.0, if an alias has been provided for a table name in the FROM clause, you can only use the alias to qualify columns from the table; the table name cannot be used elsewhere in the statement because they are flagged as syntax errors. MORE INFORMATION
As an example of the difference in behavior, assume this script has
been executed:
In both SELECT statements, notice the use of "authors" to qualify the column "au_lname" even though an alias, "aa", has been provided to substitute for the table name. On previous versions of Microsoft SQL Server, the results of each of these SELECT statements is:
Whereas on Microsoft SQL Server 6.0 the following error message is given:
In SQL Server 6.0 the following SELECT statement is equivalent to the ones above:
This behavior is NOT affected by the current setting of Trace Flag 204. Additional query words: sql6 windows nt syntax correlation alternate
Keywords : kbusage SSrvTran_SQL |
Last Reviewed: April 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |