Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
An update which does not finish
Message
De
20/04/2015 14:05:01
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01618796
Message ID:
01618798
Vues:
28
>This is weird UPDATE statement. I suggest to start from the SELECT with JOIN into a temp table and see how long that SELECT will work.
>
>If the select finishes in reasonable time, then still keep the temp table approach and just do UPDATE after the select based on PK.

What would be the difference with this:
UPDATE Client
 SET MyDate=
  (SELECT COALESCE((SELECT TOP 1 Invoice.AddDate FROM Invoice
  WHERE Invoice.NoClient=Client.Numero
  ORDER BY Invoice.Numero DESC),'1899-12-30 00:00:00'))
In that one, I also do a massive update where the inner select includes the relational of each update to be done (Client.Numero).

This one works ok.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform