IT tutorials
 
Database
 

SQL Server 2012 : Configuration Options (part 11) - Trigger Configuration Properties

1/12/2014 2:17:05 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

11. Trigger Configuration Properties

The trigger configuration properties, as shown in Table 11, control trigger behavior in SQL Server.

Table 11 Trigger Configuration Properties

c19tnt011

Trigger behavior can be set at both the server and database levels.

Nested Triggers

A trigger is a small stored procedure executed on an insert, update, or delete operation on a table. Triggers are nested when a trigger performs an action that initiates another trigger, which can initiate another trigger, and so on. Triggers can be nested up to 32 levels. You can use the nested triggers server configuration option to control whether AFTER trigger can be nested triggers.

In Management Studio, you can set the nested trigger option by selecting True (default) or False in the Allow Triggers to Fire Others option on the Server Properties Advanced tab .

To turn nested triggers OFF in code, do the following:

EXEC sp_configure ‘nested triggers', 0;
RECONFIGURE;
Note
INSTEAD OF triggers can be nested regardless of the setting of this option.

Recursive Triggers

If the code in the trigger inserts, updates, or deletes the same table again, then the trigger causes itself to be executed again. Recursion can also occur if the code in the trigger fires and performs an action that causes a trigger on another table to fire. This second trigger performs an action that causes an update to occur on the original table, which causes the original trigger to fire again. Recursive behavior is enabled or disabled by the recursive trigger database option. By default, the RECURSIVE_TRIGGERS option is set to off.

In Management Studio, the recursive triggers option can be enabled by selecting True in the Recursive Triggers Enabled option in the Database Properties Options tab (.

To set the recursive triggers option on in the AdventureWorks2012 sample database in T-SQL code, do the following:

ALTER DATABASE AdventureWorks2012 SET RECURSIVE_TRIGGERS ON;
 
Others
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us