Unix Technical Forum

SP waits for a delete trigger?

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 03:56 AM
Matik
 
Posts: n/a
Default SP waits for a delete trigger?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 03:56 AM
Erland Sommarskog
 
Posts: n/a
Default Re: SP waits for a delete trigger?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:58 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com