Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tune up the update statement
Message
De
23/09/2002 19:20:18
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Tune up the update statement
Divers
Thread ID:
00703585
Message ID:
00703585
Vues:
55
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform