General information
Forum:
Microsoft SQL Server
Category:
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only