SQL Server 2005 script help
Posted on 2009-07-09
I have 2 tables one holding customer data, the other holding referral data, now I need to update a field based upon the referrals and this needs to be done nightly, for example
CUSTOMER (Table called contact2)
REFERRAL (Table called contsupp)
ACCOUNTNO, RECTYPE, DATE
Now what I need to do is make the ULASTPROP field equal to the newest date in the referral table using the accountno as the matching field. So if I take my customer entry, I may have 4 linked entries in referral table but I need the ULASTPROP to match the date of the LATEST referral.
Now I need to run through the entire customer database (approx 160,000) every night on an automated script, but im a bit stuck on where to proceeded.