BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQLHelpSQL2000

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Jeff
Guest





PostPosted: Wed Dec 03, 2003 1:26 am    Post subject: SQLHelpSQL2000 Reply with quote



I have 2 tables I am trying to match records up in and update an id
field in table1 from the id field in table2. My only choice is to use
the timestamp and userid. We store the entrydate and userid with each
record and the records in both tables are saved within a few seconds of
each other. I want to loop through table 1, select the records from
table 2 and update a field in table 1 from table two. How can I do this
with SQL on the server? I am using SQL Server 2000.


Update table1 set idfield = select(idfield from table2 where entrydate
like table1.entrydate and userid = table1.userid)


TIA

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.