?
Solved

VB.net SQL The objects  in the FROM Clause have the same exposed names

Posted on 2014-07-24
2
Medium Priority
?
298 Views
Last Modified: 2014-07-24
Hi. I get the following error in the SQL Statement built below. How do I rectify this

The objects Polycom_Products and Polycom_Products in the FROM Clause have the same exposed names. Use correlation names to distinguish them

            Dim sSQL As String
            sSQL = "Select Polycom_Products.*, Photos.* "
            sSQL = sSQL & " From Polycom_Products Left Join Photos On Polycom_Products.Category2 = Photos.Category2 And Polycom_Products.Category3 = Photos.Category3"
            sSQL = sSQL & ",Polycom_Products Left Join Costs On Polycom_Products.[Product ID] = Costs.[ProdID]"
0
Comment
Question by:Murray Brown
[X]
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
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 40217720
It seems that you have fields with the same name in both tables (like Category2 and Category3).

Instead of querying for all fields (*), specify the name of the fields you want without duplicates.
0
 

Author Closing Comment

by:Murray Brown
ID: 40217739
Thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.
Suggested Courses

771 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