Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting error "...have the same exposed names. Use correlation names to distinguish them."

Posted on 2006-07-08
6
5,657 Views
Last Modified: 2007-12-19
I have table [Product].Items and table [Technology].Items
Note that Product and Technology are schema names, so more accurately, I have table Items in schema Products and table Items in schema Technology.

When I try to execute
SELECT [Product].Items.* FROM [Product].Items LEFT OUTER JOIN [Technology].Items ON [Product].Items.ItemID = [Technology].Items.ID

I get the error
Msg 1013, Level 16, State 1, Line 1
The objects "technology.items" and "product.items" in the FROM clause have the same exposed names. Use correlation names to distinguish them.

Why is this error occuring and what do I need to do to fix it?
0
Comment
Question by:stev0931
  • 3
  • 3
6 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17065399
Not sure about this , can you replace * with the desired column names in the Query

SELECT ProItms.Column1,  ProItms.Column2,ProItms.Column3
FROM [Product].Items ProItms
LEFT OUTER JOIN [Technology].Items
ON ProItms.ItemID = [Technology].Items.ID
0
 

Author Comment

by:stev0931
ID: 17065404
No, I get the same error
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17065419
try this


SELECT ProItms.*
FROM [Product].Items ProItms
LEFT OUTER JOIN [Technology].Items  TechItms
ON ProItms.ItemID = TechItms.ID
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:stev0931
ID: 17065429
That works, but it requires rewriting all multi-part identifyers (i.e. the TechItms.ID cannot be written as [Tech].Items.ID), which will require me to go through and rewrite a bunch of code.

Is there any other way of fixing this?
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 500 total points
ID: 17065439
The only way i feel is to provide the aliases for those tables...
0
 

Author Comment

by:stev0931
ID: 17065681
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question