Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Updates information about an operator (notification recipient) for use with alerts and jobs.
Transact-SQL syntax conventions
sp_update_operator
[ @name = ] N'name'
[ , [ @new_name = ] N'new_name' ]
[ , [ @enabled = ] enabled ]
[ , [ @email_address = ] N'email_address' ]
[ , [ @pager_address = ] N'pager_address' ]
[ , [ @weekday_pager_start_time = ] weekday_pager_start_time ]
[ , [ @weekday_pager_end_time = ] weekday_pager_end_time ]
[ , [ @saturday_pager_start_time = ] saturday_pager_start_time ]
[ , [ @saturday_pager_end_time = ] saturday_pager_end_time ]
[ , [ @sunday_pager_start_time = ] sunday_pager_start_time ]
[ , [ @sunday_pager_end_time = ] sunday_pager_end_time ]
[ , [ @pager_days = ] pager_days ]
[ , [ @netsend_address = ] N'netsend_address' ]
[ , [ @category_name = ] N'category_name' ]
[ ; ]
The name of the operator to modify. @name is sysname, with no default.
The new name for the operator. This name must be unique. @new_name is sysname, with a default of NULL
.
A number indicating the operator's current status (1
if currently enabled, 0
if not). @enabled is tinyint, with a default of NULL
. If not enabled, an operator doesn't receive alert notifications.
The e-mail address of the operator. @email_address is nvarchar(100), with a default of NULL
. This string is passed directly to the e-mail system.
The pager address of the operator. @pager_address is nvarchar(100), with a default of NULL
. This string is passed directly to the e-mail system.
Specifies the time after which a pager notification can be sent to this operator, from Monday through Friday. @weekday_pager_start_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the time after which a pager notification can't be sent to the specified operator, from Monday through Friday. @weekday_pager_end_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the time after which a pager notification can be sent to the specified operator on Saturdays. @saturday_pager_start_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the time after which a pager notification can't be sent to the specified operator on Saturdays. @saturday_pager_end_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the time after which a pager notification can be sent to the specified operator on Sundays. @sunday_pager_start_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the time after which a pager notification can't be sent to the specified operator on Sundays. @sunday_pager_end_time is int, with a default of NULL
, and must be entered in the form HHmmss
for use with a 24-hour clock.
Specifies the days that the operator is available to receive pages (subject to the specified start/end times). @pager_days is tinyint, with a default of NULL
, and must be a value from 0
through 127
. @pager_days is calculated by adding the individual values for the required days. For example, from Monday through Friday is 2
+ 4
+ 8
+ 16
+ 32
= 64
.
Value | Description |
---|---|
1 |
Sunday |
2 |
Monday |
4 |
Tuesday |
8 |
Wednesday |
16 |
Thursday |
32 |
Friday |
64 |
Saturday |
The network address of the operator to whom the network message is sent. @netsend_address is nvarchar(100), with a default of NULL
.
The name of the category for this alert. @category_name is sysname, with a default of NULL
.
0
(success) or 1
(failure).
sp_update_operator
must be run from the msdb
database.
Permissions to execute this procedure default to members of the sysadmin fixed server role.
The following example updates the operator status, setting @enabled
to true
, and sets the days (from Monday through Friday, from 8 A.M. through 5 P.M.) when the operator can be paged.
USE msdb;
GO
EXEC dbo.sp_update_operator
@name = N'François Ajenstat',
@enabled = 1,
@email_address = N'françoisa',
@pager_address = N'5551290AW@pager.Adventure-Works.com',
@weekday_pager_start_time = 080000,
@weekday_pager_end_time = 170000,
@pager_days = 64;
GO
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today