Script to set status = 'closed' and update resolution field

Script to set status = 'closed' and update resolution field

We had a technician leave and need to close his completed tickets. There are a lot of them. Has anyone written a SQL script to set Status = 'closed', set technician and set resolution? I would rather not go through the database and figure out the relationships to make this work. Or is there a way to mass close tickets in SDP? I am on version SDP version 9. 

I am thinking the script would be something like this. I just do not know where all the information is stored.
Update table1
set status = 'closed', resolution = 'resolved'
where group = 'groupname' and technician = 'unassigned'

                  New to ADSelfService Plus?