ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 7th, 2003, 11:46 AM
tlcable7 tlcable7 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Salt Lake City, UT
Posts: 9 tlcable7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SQL Query for moving duplicate records

Please help me out... I am using the following SQL Query in MS SQL Server 2000.

' COPY DUPS WITHIN THE STAGINGLIST TABLE TO THE DUPLICATES TABLE, THESE ARE FROM HITTING THE SUBMIT BUTTON MORE THAN ONCE
strSQL = "INSERT INTO Duplicates (SourceID, LeadDate, Source, FirstName, LastName, Email, Address1, Address2, City, State, Zip, Phone, AltPhone, Fax, BestTime, ProcessDate) " &_
"SELECT SourceID, LeadDate, Source, FirstName, LastName, Email, Address1, Address2, City, State, Zip, Phone, AltPhone, Fax, BestTime, ProcessDate " &_
"FROM StagingList (nolock) " &_
"WHERE LeadID IN (SELECT LeadID FROM StagingList A INNER JOIN StagingList B ON A.Phone = B.Phone " &_
"WHERE A.LeadID > B.LeadID )"
cn.Execute strSQL


I am getting this error:

Microsoft OLE DB Provider for SQL Server error '80040e14'
Ambiguous column name 'LeadID'.
/wheelchair/index.asp, line 338


I know that error means that I have not qualified what table the field is coming from, but as far as I can tell I have. Could somebody please help me with this code, or suggest a better way to check for duplicate records.

Travis Cable

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > SQL Query for moving duplicate records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT