Category: Triggers

SQL Server Triggers articles and Trigger code examples

Where is Trigger Used Most in SQL Server?

Hello everyone, In this article, I will try to give information about where Triggers are used most in SQL Server. Triggers are used in SQL Server to automatically execute a set of SQL statements or stored procedures when specific database events occur, such as INSERT, UPDATE, or DELETE operations on...

Re-Enable All Triggers in SQL Server

Hello to everyone, In this article, I will try to give information about how to reactivate all Triggers in SQL Server. In SQL Server you may want to re-enable all Triggers in some cases. You can easily do this using the code below. EXEC sp_MSforeachtable ‘ALTER TABLE ? ENABLE TRIGGER...

Trigger Preventing Table Creation in SQL Server

Hello everyone, In this article, I will provide information about creating triggers that prevent table creation in SQL Server. In SQL Server, in some cases, we may not want a table to be created in the current database. You can easily do this using the code below. CREATE TRIGGER StopTableCreation...

Listing Active Triggers in SQL Server

Hello everyone, In this section, I will talk about how to list active triggers in SQL Server. In SQL Server, in some cases, it may be necessary to list active triggers for the database. Using the code below, you can list your active triggers for your database. SELECT TAB.name AS...

Procedure to Show Script of All Triggers in SQL Server

Hello to everyone, In this article, I will give information about the procedure that show the script of all triggers in SQL Server. In some cases, you may want to script all triggers in SQL Server. You can do this easily with the help of the procedure below. –Creating the...

Enable All Triggers in SQL Server

Hello to everyone, In this article, I will give information about how to enable All Triggers in SQL Server. In SQL Server, in some cases, you may want to enable all triggers. You can do this easily with the help of the code below. –Enable All Triggers in SQL Server...

Don`t copy text!