msg 1013 level 16 – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Wed, 18 Apr 2012 11:54:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 MSG 1013 – The objects and in the FROM clause have the same exposed names https://sqlserverlearner.com/2012/04/18/msg-1103-the-objects-and-in-the-from-clause-have-the-same-exposed-names/ https://sqlserverlearner.com/2012/04/18/msg-1103-the-objects-and-in-the-from-clause-have-the-same-exposed-names/#respond Wed, 18 Apr 2012 11:54:10 +0000 https://sqlserverlearner.azurewebsites.net/2012/04/18/msg-1103-the-objects-and-in-the-from-clause-have-the-same-exposed-names/ When you try to execute a SQL Query involving From clause you get the below error:

Msg 1013, Level 16, State 1, Line 1
The objects “Table1” and “Table1” in the FROM clause have the same exposed names. Use correlation names to distinguish them.

Reason for this error:
– Same table is used multiple times in the for clause with out using alias

[sql]
CREATE TABLE Table1(A INT)
GO

SELECT * FROM Table1 join Table1 on Table1.A = Table1.A
[/sql]

Fix:
Give alias names for each table that is repeated in the query.

[sql]
SELECT * FROM Table1 T1 join Table1 T2 on T1.A = T2.A
[/sql]

]]>
https://sqlserverlearner.com/2012/04/18/msg-1103-the-objects-and-in-the-from-clause-have-the-same-exposed-names/feed/ 0