Solved

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

Posted on 2014-07-24
2
284 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:murbro
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 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:murbro
ID: 40217739
Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
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

943 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

18 Experts available now in Live!

Get 1:1 Help Now