Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many records have been updated
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01049223
Message ID:
01049991
Vues:
13
This is highly inneficient, since you would have to know the number of records being updated/processed, but it is a nice type of wrapper.. For example:

Generate a new job # (table with a jobID auto increment, number of rows, last row proc)
Load PK of records to be updated into a cursor
Get size of cursor, insert into number of rows above
Fetch and process each row (perhaps in aonther stored procedure that just receives the PK of the table being updated)
if process is sucessful then
Add 1 to the processed record count, update last row proc
else
log an error, exit procedure - if this whole thing is wrapped as a transaction, rollback, but then I am not sure if you can read the job table with the latest info....
end if
loop and fetch again
close and clean up...

So, you just need to query the job table and calculate the % completed.....
Ricardo A. Parodi
eSolar, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform