Trigger Help

  • Hi Guys,

    I am trying to create my first trigger.

    I control 2 SQL servers.

    I have a DB called Web with a table called REGUSERS.

    I want to execute a Stored Procedure on another server, when a field is changed on any entry in the REGUSERS table.

    Executing the SP is not a problem, i can do that.

    What I do not know is how write the trigger.

    When a field called UserActive in the REGUSERS table changes to "Active", I want to parse a few fields from the row that has changed, to variables, so i can use them to parse to the stored procedure.

    Any help would be greatly appreciated.

    Mark

  • What about "fields from the rows that have changed"?

    Trigger is universal thing, it will be fired everytime you do something to the data in your table. It not gonna be always single row update from you application call.

    You may find changed values in tables inseted and deleted. Read in BOL about it.

    And trigger affecting another server is not what I would suggest to do. Especially for a newbie.

    _____________
    Code for TallyGenerator

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply