MarkButler
Programmer
I have read a number of times in this forum about the use and expense of using a cursor in a stored procedure. With that in mind I was wondering how one might best accomplish the following without using a cursor.
Select all records from a table which have a status of open. If open and the due date is today, or less than today, create a record in another table (reminder) if it does not already exist. If it exists update it with appropriate information.
My initial take would have been to do the select and loop through the cursor seeing if I need to update the other table (reminder), and if so, issue a read to see if it already exists and either do an update or insert.
What would be the better solution?
TIA
Mark
Select all records from a table which have a status of open. If open and the due date is today, or less than today, create a record in another table (reminder) if it does not already exist. If it exists update it with appropriate information.
My initial take would have been to do the select and loop through the cursor seeing if I need to update the other table (reminder), and if so, issue a read to see if it already exists and either do an update or insert.
What would be the better solution?
TIA
Mark