Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Unanswered: DML triggers on schema

    I wrote a couple of triggers (instead of triggers mostly) as a solution to the polyinstantiation problem (which is not important) but it was specific to only one table all my triggers were specific to one single database i created how can i apply those triggers to every table in the schema or modify the trigger in such a way that its not hardwired to a database structure
    i use the the column names of my table specifically can i do it using just the schema of the table

    long question short
    can i create a trigger which retrieves the values of column names of a table from its schema

    any help will be appreciated thank you

  2. #2
    Join Date
    Aug 2009
    Posts
    262
    put it in a stored proc and use dynamic sql .

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You want triggers on every table? I, and I know blindman has done so also, written code that generates trigger code based on the information in the system tables.

    What do your triggers have to do?

    Your first port of call is going to have to be here anyway: http://www.dbforums.com/microsoft-sq...rs-schema.html
    George
    Home | Blog

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Example attached
    Attached Files Attached Files
    George
    Home | Blog

Posting Permissions

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