Link to home
Start Free TrialLog in
Avatar of SimpleDude
SimpleDude

asked on

UPDATING SQL SERVER TABLE

Hello, I have two tables:

ACCESS_OFFERS and ACCESS_PROCESSED

Both tables have a field called ENDDATE and OFFERIDENTIFIER

What I need to do is to update the field ENDDATE at the ACCESS_PROCESSED table where the OFFERIDENTIFIER matches.

I was planning to do a loop for ACCESS_OFFERS and then an update for each OFFERIDENTIFIER, but there is a total of 900,000 records and it takes forever.

Is there a way to do an update with a single sentence? like "update ACCESS_PROCESSED set ENDDATE = ENDATE at ACCESS_OFFERS where OFFERIDENTIFIER matches"?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Daniel Reynolds
Daniel Reynolds
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SimpleDude:

Do you have to do the update at all?  Why not simply join the tables in your query?  This would save a long update process.

Best regards,

AielloJ
Avatar of SimpleDude
SimpleDude

ASKER

Thanks!