invalid table alias

来源:互联网 发布:手机淘宝 天天特价 编辑:程序博客网 时间:2024/05/18 09:05

If an alias is assigned to a table, all explicit references to the table in the Transact-SQL statement must use the alias, not the table name. For example, the following SELECT generates a syntax error because it uses the name of the table when an alias has been assigned:

SELECT Sales.Customer.CustomerID, /* Illegal reference to Sales.Customer. */    s.NameFROM Sales.Customer AS cJOIN Sales.Store AS sON c.CustomerID = s.BusinessEntityID ;

If an alias is assigned to a table, all explicit references to the table in the Transact-SQL statement must use the alias, not the table name. For example, the following SELECT generates a syntax error because it uses the name of the table when an alias has been assigned:

就是说如果将表命名了别名,整个程序都要使用该别名。
0 0
原创粉丝点击