Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / September 2005

Tip: Looking for answers? Try searching our database.

SQL Server 7.0 & ADO Query Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Evan Dobkin - 16 Sep 2005 18:48 GMT
When running the following query against MS SQL Server 7.0:

SELECT

documentitems.manufacturerpartnumber,documentitems.customnumber01,documenthe
aders.customnumber01,documentit

ems.description,documentheaders.projectno FROM DocumentHeaders INNER JOIN
DocumentItems ON

DocumentHeaders.ID = DocumentItems.DocID WHERE (
DocumentHeaders.DocNo='ORLQ1017' AND

DocumentItems.CustomNumber01=2)

It returns 2 records (Which is correct).  The problem that I am having is
that I include in the query that

I want the DocumentHeaders.CustomNumber01 field AND the
DocumentItems.CustomerNumber01 field.  The field

names in the two different tables are the same.  The issue that I have is
that in the query results that

SQL Server returns, it returns two columns with the same name
"CustomerNumber01" and "CustomerNumber01".

SQL Server is not prefixing the field names with the table names like I did
when submitting the query.

This makes it impossible for me the retrieve the separate field values.  Is
there a way to get SQL Server

to return the table qualified names of these same named fields?

I am using ADO with Visual Basic 6 to do the query, but I would think in
theory the query should be able to be run in MS Query Analyzer or VB.
Robert Chafer - 18 Sep 2005 00:12 GMT
WRONG GROUP!!!

However... you need to rename with AS:

SELECT
 documentitems.manufacturerpartnumber, documentitems.customnumber01, documentheaders.customnumber01 AS customnumber02,  ...

>  When running the following query against MS SQL Server 7.0:
>  
[quoted text clipped - 34 lines]
>  theory the query should be able to be run in MS Query Analyzer or VB.
>  
--

Rob Chafer
Silverfrost
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.