This is a discussion on SP waits for a delete trigger? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some record in table T1. The table T1 has a trigger after delete. This is very importand for me, that the SP will be finished ASAP, that's why, I do not want, and I do not need to wait for a trigger. Does the SP will be finished, after the trigger is finished? Means, does the SP "waits" for a trigger? I think it is like that. Is it anyhow possible, to set the trigger (or the procedure) that it want's be waiting for a result of trigger execution? Thank You for kindly reply Mateusz |
| ||||
| Matik (marzec@sauron.xo.pl) writes: > I have a small question. > I call the SP outer the DB. The procedure deletes some record in table > T1. > The table T1 has a trigger after delete. > > This is very importand for me, that the SP will be finished ASAP, > that's why, I do not want, and I do not need to wait for a trigger. > > Does the SP will be finished, after the trigger is finished? > Means, does the SP "waits" for a trigger? > > I think it is like that. Is it anyhow possible, to set the trigger (or > the procedure) that it want's be waiting for a result of trigger > execution? No, and this is an essential issue. The trigger is part of the DELETE statement, and the DELETE statement must be atomic. If the trigger fails, then the DELETE statement must be rolled back. Thus, it would be inadmissable to have the trigger to complete asynchronously. The right line of attack in this case, is probably to look at what the trigger performs. Must all that work be performed in the realm of the transaction? Without knowing what the trigger does it is impossible for me to say. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp |