November 15, 2004 at 8:05 am
I'm looking (IF exists) the way to activate a trigger only when a column have a determinated value (The column will receive any value, but only one of these will activate the trigger. Actually I'm using the inserted table on the trigger for check that value, but exist any different way to do this????
November 15, 2004 at 8:22 am
the trigger will always be firred, but will only perform some stuf when meeting some criteria.
CREATE TRIGGER TR_mytable_ins ON [Mytable]
FOR INSERT
AS
BEGIN
if inserted.Mycolumn = 'myvalue'
begin
my work to be done
end
END
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
November 15, 2004 at 8:36 am
ALZDBA, that is the way that is actually working. Do you know any other way to do this?
November 16, 2004 at 12:20 am
That's the concept of triggers, fire always when from the designed action.
If you have full control regarding the invocation of the designed action (insert/update/delete), you can use a sp or have you program adjusted to perform the wanted action.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply