Solved

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

Posted on 2006-07-08
6
5,588 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
Comment Utility
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
Comment Utility
No, I get the same error
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
Comment Utility
try this


SELECT ProItms.*
FROM [Product].Items ProItms
LEFT OUTER JOIN [Technology].Items  TechItms
ON ProItms.ItemID = TechItms.ID
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:stev0931
Comment Utility
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
Comment Utility
The only way i feel is to provide the aliases for those tables...
0
 

Author Comment

by:stev0931
Comment Utility
Thanks!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now