DML Trigger on Database not on table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sowjanya D
    New Member
    • Mar 2015
    • 3

    DML Trigger on Database not on table

    If i make any changes(Insert/Delete/Update)in a site then the corresponding changes will store in tables of that particular DB.
    How to know on which table which operation(DDl/DMl)has done.
    I would like to store DML activities on Database level in a table,not on perticular Table, Please help
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Depending on the version of SQL Server you are using, you may want to look at DDL trigger.

    Good luck


    ~~ CK

    Comment

    • Sowjanya D
      New Member
      • Mar 2015
      • 3

      #3
      Yes I got the DDL trigger for whole Database but I am not getting the DML trigger for Database, DML triggers are only applicable for Tables, How can I do that to solve my problem.

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        I'm not sure what you are asking. Data Modification Language (DML) are done in a table. If you want to know which table was updated, you might need to set that up every table. Or checkout Change Data Capture and find out which got updated.

        Good Luck!!!

        ~~ CK

        Comment

        • Sowjanya D
          New Member
          • Mar 2015
          • 3

          #5
          for DML we need to write trigger for each table but for my DB there are more number of tables so it is complicated to create each trigger for each table.
          I think CDC can be applicable only on user database not on system database.so can you elaborate the working procedure of CDC.

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            System tables should not be modified like that. You should handle that on user-rights setting. For Data Modification Languages, your only option is trigger or CDC (check BOL). For DDL Languages, you can use database triggers.

            Good Luck!!!


            ~~ CK

            Comment

            Working...