Solved

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

Posted on 2014-07-24
2
287 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 70

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Slow Connectivity over ODBC 8 35
SQL Replication question 9 42
Find SQL query used by application 3 19
syntax sql error 2 10
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

772 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