Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default database trigger

    Have a table of registered users, I'll call it "users." It has fields email,
    username, password and accesslevel.

    When a user registers on our site, I would like a database entry entered into
    the "user" table, but also a new record should be inserted into my blog
    software user table, and possibly other tables, but for the sake of simplicity
    I'll keep it to one and assume I can repeat the process for each table.

    Can anyone share with me how to write this code in SQL Enterprise Manager? I
    would also want this to change the child entry in the child table whenever a
    record in the "user" table was updated or deleted.

    cfpaperboy Guest

  2. Similar Questions and Discussions

    1. XML.TRIGGER
      Hello. I have an XML connector that I'm using a tigger event on. I was wondering if anyone knows a way for me to check when this completes. I...
    2. Trigger
      I have three tables: class - table of classes ---------- classID className classtypeID classtype - table of class types --------------
    3. Trigger Help
      I have a trigger (code below). Where do I put in IF statements to kick off the CASE? I put in a commented out example of the IF I want to do in...
    4. @@rowcount in trigger
      Hi, I read in a book which suggested to check the @@rowncount inside the trigger if it is =0 then return if @@rowncount=0 Return I am wondering...
    5. Trigger key
      Hi, I need to create a insert trigger so that when a new row is inserted in table A then the same row is inserted in table B on a remote server....
  3. #2

    Default Re: database trigger

    Right out of SQL Server BOL.....


    Phil

    CREATE TRIGGER
    Creates a trigger, which is a special kind of stored procedure that executes
    automatically when a user attempts the specified data-modification statement
    on the specified table. Microsoft? SQL Server allows the creation of multiple
    triggers for any given INSERT, UPDATE, or DELETE statement.

    Syntax
    CREATE TRIGGER trigger_name
    ON { table | view }
    [ WITH ENCRYPTION ]
    {
    { { FOR | AFTER | INSTEAD OF } { [ INSERT ] [ , ] [ UPDATE ] }
    [ WITH APPEND ]
    [ NOT FOR REPLICATION ]
    AS
    [ { IF UPDATE ( column )
    [ { AND | OR } UPDATE ( column ) ]
    [ ...n ]
    | IF ( COLUMNS_UPDATED ( ) { bitwise_operator } updated_bitmask )
    { comparison_operator } column_bitmask [ ...n ]
    } ]
    sql_statement [ ...n ]
    }
    }

    paross1 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139