Настройка конфигурации сервера nested triggersConfigure the nested triggers Server Configuration Option
Применимо к:Applies to: SQL ServerSQL Server (все поддерживаемые версии)
SQL ServerSQL Server (all supported versions)
SQL ServerSQL Server (все поддерживаемые версии)
SQL ServerSQL Server (all supported versions)
В этом разделе описывается настройка параметра конфигурации сервера nested triggers в SQL Server 2019 (15.x)SQL Server 2019 (15.x) с помощью SQL Server Management StudioSQL Server Management Studio или Transact-SQLTransact-SQL.This topic describes how to configure the nested triggers server configuration option in SQL Server 2019 (15.x)SQL Server 2019 (15.x) by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. Параметр nested triggers определяет, допустимо ли каскадирование триггеров AFTER.The nested triggers option controls whether an AFTER trigger can cascade. Под этим подразумевается выполнение действия, вызывающего срабатывание другого триггера, который может инициировать другой триггер, и т. д.That is, perform an action that initiates another trigger, which initiates another trigger, and so on. Когда параметр nested triggers принимает значение 0, триггеры AFTER не могут вызывать каскадные действия.When nested triggers is set to 0, AFTER triggers cannot cascade. Если параметр nested triggers равен 1 (значение по умолчанию), триггеры AFTER могут выполнять каскадные действия глубиной до 32 уровней.When nested triggers is set to 1 (the default), AFTER triggers can cascade to as many as 32 levels. Триггеры INSTEAD OF могут быть вложенными вне зависимости от этого параметра.INSTEAD OF triggers can be nested regardless of the setting of this option.
В этом разделеIn This Topic
Перед началом работыBefore you begin:
Настройка параметра nested triggers с использованием следующих средств:To configure the nested triggers option, using:
Среда SQL Server Management StudioSQL Server Management Studio
Дальнейшие действия. После настройки параметра nested triggersFollow Up: After you configure the nested triggers option
Перед началомBefore You Begin
безопасностьSecurity
PermissionsPermissions
Разрешения на выполнение хранимой процедуры sp_configure без параметров или только с первым параметром по умолчанию предоставляются всем пользователям.Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. Для выполнения процедуры sp_configure с обоими параметрами для изменения параметра конфигурации или запуска инструкции RECONFIGURE необходимо иметь разрешение ALTER SETTINGS на уровне сервера.To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. Разрешение ALTER SETTINGS неявным образом предоставлено предопределенным ролям сервера sysadmin и serveradmin .The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.
Использование среды SQL Server Management StudioUsing SQL Server Management Studio
Настройка параметра nested triggersTo configure the nested triggers option
В обозревателе объектовщелкните сервер правой кнопкой мыши и выберите пункт Свойства.In Object Explorer, right-click a server, and then select Properties.
На странице Дополнительно выберите значение True (по умолчанию) или False для параметра Разрешить триггерам активировать другие триггеры.On the Advanced page, set the Allow Triggers to Fire Others option to True (the default) or False.
Использование Transact-SQLUsing Transact-SQL
Настройка параметра nested triggersTo configure the nested triggers option
Установите соединение с компонентом Компонент Database EngineDatabase Engine.Connect to the Компонент Database EngineDatabase Engine.
На панели «Стандартная» нажмите Создать запрос.From the Standard bar, click New Query.
Скопируйте следующий пример в окно запроса и нажмите кнопку Выполнить.Copy and paste the following example into the query window and click Execute. В этом примере описывается использование процедуры sp_configure для задания значения параметра
nested triggers
равным0
.This example shows how to use sp_configure to set the value of thenested triggers
option to0
.
USE AdventureWorks2012 ;
GO
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE ;
GO
EXEC sp_configure 'nested triggers', 0 ;
GO
RECONFIGURE;
GO
Дополнительные сведения см. в разделе Параметры конфигурации сервера (SQL Server).For more information, see Server Configuration Options (SQL Server).
Дальнейшие действия. После настройки параметра nested triggersFollow Up: After you configure the nested triggers option
Параметр вступает в силу немедленно, без перезапуска сервера.The setting takes effect immediately without restarting the server.
См. также:See Also
Создание вложенных триггеров Create Nested Triggers
RECONFIGURE (Transact-SQL) RECONFIGURE (Transact-SQL)
Параметры конфигурации сервера (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)sp_configure (Transact-SQL)