Skip to content

Commit 63f906b

Browse files
Merge pull request #35978 from rwestMSFT/rw-1201-fix-536936
Clarify sp_add_operator category (UUF 536936)
2 parents 6201eb0 + e13ecbe commit 63f906b

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

docs/relational-databases/system-stored-procedures/sp-add-operator-transact-sql.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Creates an operator (notification recipient) for use with alerts a
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 06/23/2025
7+
ms.date: 12/01/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -27,8 +27,8 @@ Creates an operator (notification recipient) for use with alerts and jobs.
2727
## Syntax
2828

2929
```syntaxsql
30-
sp_add_operator
31-
[ @name = ] 'name'
30+
dbo.sp_add_operator
31+
[ @name = ] N'name'
3232
[ , [ @enabled = ] enabled ]
3333
[ , [ @email_address = ] N'email_address' ]
3434
[ , [ @pager_address = ] N'pager_address' ]
@@ -40,13 +40,13 @@ sp_add_operator
4040
[ , [ @sunday_pager_end_time = ] sunday_pager_end_time ]
4141
[ , [ @pager_days = ] pager_days ]
4242
[ , [ @netsend_address = ] N'netsend_address' ]
43-
[ , [ @category_name = ] 'category' ]
43+
[ , [ @category_name = ] N'category_name' ]
4444
[ ; ]
4545
```
4646

4747
## Arguments
4848

49-
#### [ @name = ] '*name*'
49+
#### [ @name = ] N'*name*'
5050

5151
The name of an operator (notification recipient). This name must be unique and can't contain the percent (`%`) character. *@name* is **sysname**, with no default.
5252

@@ -71,31 +71,33 @@ The pager address of the operator. This string is passed directly to the e-mail
7171

7272
#### [ @weekday_pager_start_time = ] *weekday_pager_start_time*
7373

74-
The time after which [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] Agent sends pager notification to the specified operator on the weekdays, from Monday through Friday. *@weekday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
74+
The start time when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service sends pager notifications to the operator, from Monday through Friday. *@weekday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
7575

7676
#### [ @weekday_pager_end_time = ] *weekday_pager_end_time*
7777

78-
The time after which [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notification to the specified operator on the weekdays, from Monday through Friday. *weekday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
78+
The end time when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notifications to the operator, from Monday through Friday. *@weekday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
7979

8080
#### [ @saturday_pager_start_time = ] *saturday_pager_start_time*
8181

82-
The time after which [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service sends pager notification to the specified operator on Saturdays. *saturday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
82+
The start time on Saturdays when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service sends pager notifications to the operator. *@saturday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
8383

8484
#### [ @saturday_pager_end_time = ] *saturday_pager_end_time*
8585

86-
The time after which [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notification to the specified operator on Saturdays. *@saturday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
86+
The end time on Saturdays when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notifications to the operator. *@saturday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
8787

8888
#### [ @sunday_pager_start_time = ] *sunday_pager_start_time*
8989

90-
The time after which [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service sends pager notification to the specified operator on Sundays. *@sunday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
90+
The start time on Sundays when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service sends pager notifications to the operator. *@sunday_pager_start_time* is **int**, with a default of `090000`, which indicates 9:00 A.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
9191

9292
#### [ @sunday_pager_end_time = ] *sunday_pager_end_time*
9393

94-
The time after which [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notification to the specified operator on Sundays. *@sunday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
94+
The end time on Sundays when the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Agent service no longer sends pager notifications to the operator. *@sunday_pager_end_time* is **int**, with a default of `180000`, which indicates 6:00 P.M. on a 24-hour clock, and must be entered using the form `HHmmss`.
9595

9696
#### [ @pager_days = ] *pager_days*
9797

98-
A number that indicates the days that the operator is available for pages (subject to the specified start/end times). *@pager_days* is **tinyint**, with a default of `0` indicating the operator is never available to receive a page. Valid values are 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 = 62`. The following table lists the value for each day of the week.
98+
A number that indicates the days that the operator is available for pages (subject to the specified start/end times). *@pager_days* is **tinyint**, with a default of `0`, indicating the operator is never available to receive a page. Valid values are 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 = 62`.
99+
100+
The following table lists the value for each day of the week.
99101

100102
| Value | Description |
101103
| --- | --- |
@@ -111,10 +113,17 @@ A number that indicates the days that the operator is available for pages (subje
111113

112114
The network address of the operator to whom the network message is sent. *@netsend_address* is **nvarchar(100)**, with a default of `NULL`.
113115

114-
#### [ @category_name = ] '*category*'
116+
#### [ @category_name = ] N'*category_name*'
115117

116118
The name of the category for this operator. *@category_name* is **sysname**, with a default of `NULL`.
117119

120+
If this value is `NULL`, the operator is added with a default category of `[Uncategorized]`. You can also choose from an existing category, by querying the `syscategories` table in the `msdb` database:
121+
122+
```sql
123+
SELECT name
124+
FROM msdb.dbo.syscategories;
125+
```
126+
118127
## Return code values
119128

120129
`0` (success) or `1` (failure).

0 commit comments

Comments
 (0)