SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


execute triggers externally


execute triggers externally

Author
Message
Avaneesh -388582
Avaneesh -388582
SSC-Addicted
SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)SSC-Addicted (408 reputation)

Group: General Forum Members
Points: 408 Visits: 99
I mean can we execute triggers by directly invoking them as we call the stored procedure or the UDFs. Is there any way to do so through front end (using VB or C#). If any body has an answer for this question pls do reply

Regards

Avaneesh Bajoria.
Giri Duddu
Giri Duddu
SSChasing Mays
SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)

Group: General Forum Members
Points: 645 Visits: 94
I dont think it is a relavent question.
As if u direct execute them how do u get data into inserted..... tables.
So, it can not be allowed to do like that.
Kent Waldrop
Kent Waldrop
SSC Eights!
SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)

Group: General Forum Members
Points: 940 Visits: 467
The short version of the answer is, "No, this is not allowed."
Michael Earl-395764
Michael Earl-395764
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13337 Visits: 23078
TRIGGERS are based on an INSERT, UPDATE, or DELETE happening. So, you can cause a trigger to fire by simply doing one of those actions - it does not mean you have to change anything:

UPDATE MyTable SET Field1 = Field1

The update trigger would fire and I have not really changed any data.

If you find yourself having to do this regularly, it is a big red flag that you are likely to have a design issue. Triggers are there to act on data changes, so if you need them to act when there is not a data change, you are likely to have misused them.
If this is simply because triggers were disabled for some time and you need them to fire now, I can see that being a reasonable reason for having to do something like this.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search