DELETE operations in SQL Server can be inherently slow; you are not helping things by using a cursor as well. As Imar suggested, you don't need a cursor - simply JOIN each of your tables to the 'source' table. The results of the JOIN then specify the rows to be deleted. For example:
Code:
DELETE FROM TestAktionen_T
INNER JOIN Tests_T ON Tests_T.TestID=TestAktionen_T.TestID
INNER JOIN TestTickets_T ON Tests_T.TestVorgangID=TestTickets_T.TestVorgangID
WHERE TestTickets_T.TestTicketID=@ticketNum
etc.
The DELETE operation must maintain all the index entries on all the rows being deleted, if you have a lot of indexes, this will take some time. If there is other user activity, the DELETE may be blocking until it is able to obtain exclusive locks and this will take time as well.
You might try extending the query timeout on the command object.
Removing the cursor should speed things up considerably, though.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com