MSG 1013 – The objects and in the FROM clause have the same exposed names

Posted on : 18-04-2012 | By : Devi Prasad | In : SQL Errors

Share:

0


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]




References : Devi Prasad (sqlserverlearner.com)

Need Help On SQL Server?

Cannot Find Solution to your problem (or) If you are looking for some help on SQL Server. Dont worry Click Here to Post your question and solve your issue.


Do you like my blog?

If you liked reading this blog, please help spread the word by sharing this blog with your friends.




Write a comment



Tags: , , ,