Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tune up the update statement
Message
From
23/09/2002 19:20:18
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Tune up the update statement
Miscellaneous
Thread ID:
00703585
Message ID:
00703585
Views:
54
this update statement takes 10 to 20 seconds to run. anyway to tune up the statement?

update ea
set ea.Next_Activity_Date_New = rn.date_
from employee_accounts ea
inner join (select min(appt_date) as date_,company from rn_appointments
where appt_date > convert(varchar(20), getdate(),1) and (activity_complete is null or activity_complete = 0)
group by company) as rn
on rn.company = ea.company_id
where (ea.delete_flag is null or ea.delete_flag = 0) and ea.employee_id = @employee_id
Next
Reply
Map
View

Click here to load this message in the networking platform