您的位置:首页 > 其它

invalid table alias

2016-06-01 14:44 169 查看
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.Name
FROM Sales.Customer AS c
JOIN Sales.Store AS s
ON 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:

就是说如果将表命名了别名,整个程序都要使用该别名。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: