Thanks for your response My requirements are as follows:
The purpose of my stored procedure is to change records in a resolved status to closed. By making this change I will have to update multiple tables that are impacted by the change.
My thinking behind it was to identify all the records that are in a resolved status. From there get the unique id that is used by the other two child tables and update/insert them based on that unique id.
Based on this I was thinking of using a while statement as I cycle through the records to update the two child tables and the main table.
My stored procedure is pretty general because I have just started coding and I have only declared my variables.
I was thinking of using my counter on my while statement as the total number of records that returned from the parent table and the total number of tickets that were resolved.
-
-
SET @COUNTER = (SELECT COUNT(dbo.call_req.status) AS Stat_Count FROM bo.call_req INNER JOIN dbo.ca_contact ON dbo.call_req.group_id = dbo.ca_contact.contact_uuid WHERE(SUBSTRING(dbo.ca_contact.last_name, 1, 3) = 'GSA') AND (dbo.call_req.status = N're'))
-
-
.
As I mentioned I have a strong MS Access background but if there is a better method of doing it I welcome it. If you have links or examples that would be very helpful.
thanks for the help