Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
I wish I could. The inner loop processes selected rows ("Open" and "Close") from the subsidiary table and calculates the "age" of the parent row based on the cumulative differences between all the Open and Close records PLUS the difference between the last Open record and today's date.
I had a suggestion from another source that since I have the key to the parent row in a variable from the outer look (@corr_ID) I could do an UPDATE etc. WHERE Correspendence_ID = @corr_ID and not worry about using the cursor to position for the update. That way I can use a Read-Only Forward cursor. Sounds tempting. Although I'd still like to understand how to do a FOR UPDATE cursor in a Stored Procedure, even if just to have the theoretical basis.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement