locked
Set default sql trigger for all insert update and delete for all tables RRS feed

  • Question

  • User1910487977 posted

    Set default sql trigger for all insert update and delete for all tables in database.

    Example will be appreciated.

    Thursday, August 29, 2019 6:01 AM

Answers

  • User-719153870 posted

    Hi UmerFaiz001,

    Set default sql trigger for all insert update and delete for all tables in database.

    As far as i know, I don't think you can add a trigger to multiple tables at the same time.

    You can only add one trigger to one table in one time, if you want to add the same trigger to all the tables in your database, you will need to copy and paste the sql code and change the table name in your code.

    Example will be appreciated.

    About how to create a trigger to a table for insert, update and delete, please refer to below code and links:

    create trigger TR_ALL --this is your trigger name
    on Files--this is your table name
    for insert,update,delete
    as
    select 'success'

    CREATE TRIGGER

    Trigger examples

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 29, 2019 7:49 AM

All replies

  • User-719153870 posted

    Hi UmerFaiz001,

    Set default sql trigger for all insert update and delete for all tables in database.

    As far as i know, I don't think you can add a trigger to multiple tables at the same time.

    You can only add one trigger to one table in one time, if you want to add the same trigger to all the tables in your database, you will need to copy and paste the sql code and change the table name in your code.

    Example will be appreciated.

    About how to create a trigger to a table for insert, update and delete, please refer to below code and links:

    create trigger TR_ALL --this is your trigger name
    on Files--this is your table name
    for insert,update,delete
    as
    select 'success'

    CREATE TRIGGER

    Trigger examples

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 29, 2019 7:49 AM
  • User1910487977 posted

    Thanks ... Any further live record data example apart from the above example.

    Thursday, August 29, 2019 10:15 AM
  • User-719153870 posted

    Hi UmerFaiz001,

    Any further live record data example apart from the above example.

    What is live record data example?

    The two links ( especialy the second link ) i provided in my early post is complete and data related, have you checked it?

    Best Regard,

    Yang Shen

    Friday, August 30, 2019 7:24 AM