Results 1 to 2 of 2

Thread: Trigger

  1. #1
    Join Date
    Dec 1969

    Default Trigger

    I have the following Trigger example ....<BR><BR>CREATE TRIGGER trg_updatedt ON [dbo].[tablename] <BR>FOR UPDATE<BR>AS<BR>UPDATE tablename <BR>set modified = getdate()<BR>from inserted<BR>where tablename.colid = inserted.colid<BR><BR>I have never created a Trigger before and the above is justa sample I pulled from a website. My questions are, where does this trigger get placed, and what tells SQL to run it?

  2. #2
    Join Date
    Dec 1969

    Default RE: Trigger

    The textual definition for the trigger is stored in the data dictionary. The trigger code will be executed when an update on the table is done. By default, the update in the trigger will not cause the trigger to be executed.<BR><BR>This type of functionality is not what triggers should be used for in my opinion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts