By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

SP waits for a delete trigger?

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Matik (ma****@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, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.