Skip to content

Commit 9cde570

Browse files
authored
Merge pull request #34511 from rwestMSFT/rw-0623-stored-procedures-012
System stored procedure refresh - phase 12
2 parents 89d8917 + b34cf4e commit 9cde570

File tree

40 files changed

+295
-294
lines changed

40 files changed

+295
-294
lines changed

docs/relational-databases/system-stored-procedures/sys-sp-add-object-to-event-stream-group-transact-sql.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,91 +3,91 @@ title: "sys.sp_add_object_to_event_stream_group (Transact-SQL)"
33
description: "Adds an object to a stream group for the change event streaming feature introduced in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)] by using Transact-SQL (T-SQL)."
44
author: sasapopo
55
ms.author: sasapopo
6-
ms.reviewer: mathoma, mikeray
7-
ms.date: 05/19/2025
6+
ms.reviewer: mathoma, mikeray, randolphwest
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
11+
ms.custom:
12+
- build-2025
1113
f1_keywords:
1214
- "sys_sp_add_object_to_event_stream_group_TSQL"
1315
- "sys_sp_add_object_to_event_stream_group"
1416
helpviewer_keywords:
1517
- "sys_sp_add_object_to_event_stream_group"
1618
dev_langs:
1719
- "TSQL"
18-
monikerRange: " = sql-server-ver17 || = sql-server-linux-ver17 "
19-
ms.custom:
20-
- build-2025
20+
monikerRange: "=sql-server-ver17 || =sql-server-linux-ver17"
2121
---
2222
# sys.sp_add_object_to_event_stream_group (Transact-SQL)
2323

2424
[!INCLUDE [sqlserver2025](../../includes/applies-to-version/sqlserver2025.md)]
2525

26-
Adds an object (that is, a table) to the stream group for the [change event streaming (CES)](../track-changes/change-event-streaming/overview.md) feature introduced in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)].
26+
Adds an object (that is, a table) to the stream group for the [change event streaming (CES)](../track-changes/change-event-streaming/overview.md) feature introduced in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)].
2727

28-
> [!NOTE]
29-
> Change event streaming is currently in **preview** for SQL Server 2025.
28+
> [!NOTE]
29+
> Change event streaming is currently in **preview** for [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)].
3030
3131
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3232

3333
## Syntax
3434

3535
```syntaxsql
3636
sp_add_object_to_event_stream_group
37-
[ @stream_group_name = ] N'stream_group_name'
38-
, [ @object_name ] = N'schema_name_dot_object_name'
39-
[ , [ @include_all_columns ] = include_all_columns ]
40-
[ , [ @include_old_values ] = include_old_values ]
41-
[ , [ @include_old_lob_values] = include_old_lob_values ]
37+
[ @stream_group_name = ] N'stream_group_name'
38+
, [ @object_name ] = N'schema_name_dot_object_name'
39+
[ , [ @include_all_columns ] = include_all_columns ]
40+
[ , [ @include_old_values ] = include_old_values ]
41+
[ , [ @include_old_lob_values ] = include_old_lob_values ]
4242
```
4343

4444
## Arguments
4545

46-
#### [ @stream_group_name = ] N'stream_group_name'
46+
#### [ @stream_group_name = ] N'*stream_group_name*'
4747

4848
Specifies the name of the event stream group you want to add the table to. *@stream_group_name* is **sysname**, and can't be `NULL`.
4949

50-
#### [ @object_name ] = N'schema_name_dot_object_name'
50+
#### [ @object_name ] = N'*schema_name_dot_object_name*'
5151

52-
Specifies the name of the table you want to stream as part of the specified stream group. *@object_name* is **nvarchar(512)**, and can't be `NULL`.
52+
Specifies the name of the table you want to stream as part of the specified stream group. *@object_name* is **nvarchar(512)**, and can't be `NULL`.
5353

5454
Use a two-part name for the column that includes both the schema name and column name. For example, a valid value is `dbo.Addresses`.
5555

56-
#### [ @include_all_columns ] = include_all_columns
56+
#### [ @include_all_columns ] = *include_all_columns*
5757

58-
Defines what columns to include within the payload of the message that streams the changes made to the specified table. *@include_all_columns* is **bit**, and can't be `NULL`.
58+
Defines what columns to include within the payload of the message that streams the changes made to the specified table. *@include_all_columns* is **bit**, and can't be `NULL`.
5959

6060
*@include_all_columns* can be one of the following values:
6161

6262
| Value | Description |
63-
|---|---|
64-
| `1` (default) | Includes all columns within the payload of the message that streams the changes made to the specified table. |
63+
| --- | --- |
64+
| `1` (default) | Includes all columns within the payload of the message that streams the changes made to the specified table. |
6565
| `0` | Only includes columns that have changed within the payload of the message that streams the changes made to the specified table. |
6666

67-
#### [ @include_old_values ] = include_old_values
67+
#### [ @include_old_values ] = *include_old_values*
6868

69-
If specified, determines if old values are included within the payload of the message that streams the changes made to the specified table. *@include_old_values* is **bit**, and can't be `NULL`. This parameter is optional.
69+
If specified, determines if old values are included within the payload of the message that streams the changes made to the specified table. *@include_old_values* is **bit**, and can't be `NULL`. This parameter is optional.
7070

71-
Old values are the values of the column before the change was made. For example, if a row is updated, the old values are the values of the columns before the update.
71+
Old values are the values of the column before the change was made. For example, if a row is updated, the old values are the values of the columns before the update.
7272

7373
*@include_old_values* can be one of the following:
7474

7575
| Value | Description |
76-
|---|---|
77-
| `1` (default) | Includes old values within the payload of the message that streams the changes made to the specified table. |
76+
| --- | --- |
77+
| `1` (default) | Includes old values within the payload of the message that streams the changes made to the specified table. |
7878
| `0` | Skips old values within the payload of the message that streams the changes made to the specified table. |
7979

80-
#### [ @include_old_lob_values] = include_old_lob_values
80+
#### [ @include_old_lob_values ] = *include_old_lob_values*
8181

82-
Determines if old changed large objects (LOB) values are included within the payload of the message that streams the changes made to the specified table. '@include_old_lob_values* is **bit**, and can't be `NULL`.
82+
Determines if old changed large objects (LOB) values are included within the payload of the message that streams the changes made to the specified table. '@include_old_lob_values* is **bit**, and can't be `NULL`.
8383

84-
Old values are the values of the column before the change was made. For example, if a row is updated, the old values are the values of the columns before the update.
84+
Old values are the values of the column before the change was made. For example, if a row is updated, the old values are the values of the columns before the update.
8585

8686
'@include_old_lob_values* can be one of the following values:
8787

8888
| Value | Description |
89-
|---|---|
90-
| `1` | Includes all columns within the payload of the message that streams the changes made to the specified table. |
89+
| --- | --- |
90+
| `1` | Includes all columns within the payload of the message that streams the changes made to the specified table. |
9191
| `0` (default) | Only includes columns that have changed within the payload of the message that streams the changes made to the specified table. |
9292

9393
## Return code values
@@ -101,4 +101,4 @@ A user with [CONTROL database permissions](../security/permissions-database-engi
101101
## Related content
102102

103103
- [What is change event streaming?](../track-changes/change-event-streaming/overview.md)
104-
- [Configure change event streaming](../track-changes/change-event-streaming/configure.md)
104+
- [Configure change event streaming](../track-changes/change-event-streaming/configure.md)

docs/relational-databases/system-stored-procedures/sys-sp-add-trusted-assembly-transact-sql.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Adds an assembly to the list of trusted assemblies for the server.
44
author: VanMSFT
55
ms.author: vanto
66
ms.reviewer: randolphwest
7-
ms.date: 03/07/2025
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -61,9 +61,7 @@ Requires membership in the **sysadmin** fixed server role or CONTROL SERVER perm
6161
The following example adds an assembly named `pointudt` to the list of trusted assemblies for the server. These values are available from [sys.assemblies](../system-catalog-views/sys-assemblies-transact-sql.md).
6262

6363
```sql
64-
EXEC sp_add_trusted_assembly
65-
0x8893AD6D78D14EE43DF482E2EAD44123E3A0B684A8873C3F7BF3B5E8D8F09503F3E62370CE742BBC96FE3394477214B84C7C1B0F7A04DCC788FA99C2C09DFCCC,
66-
N'pointudt, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil';
64+
EXECUTE sp_add_trusted_assembly 0x8893AD6D78D14EE43DF482E2EAD44123E3A0B684A8873C3F7BF3B5E8D8F09503F3E62370CE742BBC96FE3394477214B84C7C1B0F7A04DCC788FA99C2C09DFCCC, N'pointudt, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil';
6765
```
6866

6967
## Related content

docs/relational-databases/system-stored-procedures/sys-sp-cdc-add-job-transact-sql.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Creates a change data capture cleanup or capture job in the curren
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -119,7 +119,8 @@ The following example creates a capture job. This example assumes that the exist
119119
```sql
120120
USE AdventureWorks2022;
121121
GO
122-
EXEC sys.sp_cdc_add_job @job_type = N'capture';
122+
123+
EXECUTE sys.sp_cdc_add_job @job_type = N'capture';
123124
GO
124125
```
125126

@@ -131,7 +132,7 @@ The following example creates a cleanup job in the [!INCLUDE [ssSampleDBnormal](
131132
USE AdventureWorks2022;
132133
GO
133134

134-
EXEC sys.sp_cdc_add_job
135+
EXECUTE sys.sp_cdc_add_job
135136
@job_type = N'cleanup',
136137
@start_job = 0,
137138
@retention = 5760;

docs/relational-databases/system-stored-procedures/sys-sp-cdc-cleanup-change-table-transact-sql.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Removes rows from the change table in the current database based on
44
author: briancarrig
55
ms.author: brcarrig
66
ms.reviewer: randolphwest
7-
ms.date: 07/25/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -79,14 +79,15 @@ None, unless the optional *@fCleanupFailed* OUTPUT parameter is used.
7979
SELECT @cleanup_failed_bit = 0;
8080

8181
-- Execute cleanup and obtain output bit
82-
EXEC @retcode = sys.sp_cdc_cleanup_change_table
82+
EXECUTE
83+
@retcode = sys.sp_cdc_cleanup_change_table
8384
@capture_instance = '<CaptureInstance>',
8485
@low_water_mark = @LSN, --== LSN to be used for new low watermark for capture instance
8586
@threshold = 1,
8687
@fCleanupFailed = @cleanup_failed_bit OUTPUT;
8788

8889
-- Leverage @cleanup_failed_bit output to check the status.
89-
SELECT IIF(@cleanup_failed_bit > 0, 'CLEANUP FAILURE', 'CLEANUP SUCCESS');
90+
SELECT IIF (@cleanup_failed_bit > 0, 'CLEANUP FAILURE', 'CLEANUP SUCCESS');
9091
```
9192

9293
```output

docs/relational-databases/system-stored-procedures/sys-sp-cdc-drop-job-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Removes a change data capture cleanup or capture job for the curre
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -63,7 +63,7 @@ The following example removes the cleanup job for the [!INCLUDE [sssampledbobjec
6363
USE AdventureWorks2022;
6464
GO
6565

66-
EXEC sys.sp_cdc_drop_job @job_type = N'cleanup';
66+
EXECUTE sys.sp_cdc_drop_job @job_type = N'cleanup';
6767
```
6868

6969
## Related content

docs/relational-databases/system-stored-procedures/sys-sp-cdc-enable-table-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Enables change data capture for the specified source table in the
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -163,7 +163,7 @@ The following example enables change data capture for the `HumanResources.Depart
163163
USE AdventureWorks2022;
164164
GO
165165

166-
EXEC sys.sp_cdc_enable_table
166+
EXECUTE sys.sp_cdc_enable_table
167167
@source_schema = N'HumanResources',
168168
@source_name = N'Department',
169169
@role_name = N'cdc_admin',

docs/relational-databases/system-stored-procedures/sys-sp-cdc-generate-wrapper-function-transact-sql.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Generates scripts to create wrapper functions for the change data
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -80,31 +80,26 @@ The following example show how you can use `sys.sp_cdc_generate_wrapper_function
8080
```sql
8181
DECLARE @wrapper_functions TABLE (
8282
function_name SYSNAME,
83-
create_script NVARCHAR(MAX)
84-
);
83+
create_script NVARCHAR (MAX));
8584

8685
INSERT INTO @wrapper_functions
87-
EXEC sys.sp_cdc_generate_wrapper_function;
86+
EXECUTE sys.sp_cdc_generate_wrapper_function;
8887

89-
DECLARE @create_script NVARCHAR(MAX);
88+
DECLARE @create_script AS NVARCHAR (MAX);
9089

9190
DECLARE #hfunctions CURSOR LOCAL FAST_FORWARD
92-
FOR
93-
SELECT create_script
94-
FROM @wrapper_functions;
91+
FOR SELECT create_script
92+
FROM @wrapper_functions;
9593

9694
OPEN #hfunctions;
9795

98-
FETCH #hfunctions
99-
INTO @create_script;
96+
FETCH #hfunctions INTO @create_script;
10097

10198
WHILE (@@fetch_status <> -1)
102-
BEGIN
103-
EXEC sp_executesql @create_script
104-
105-
FETCH #hfunctions
106-
INTO @create_script
107-
END;
99+
BEGIN
100+
EXECUTE sp_executesql @create_script;
101+
FETCH #hfunctions INTO @create_script;
102+
END
108103

109104
CLOSE #hfunctions;
110105

docs/relational-databases/system-stored-procedures/sys-sp-cdc-get-captured-columns-transact-sql.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Returns change data capture metadata information for the captured
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -83,8 +83,7 @@ The following example returns information about the captured columns in the `Hum
8383
USE AdventureWorks2022;
8484
GO
8585

86-
EXECUTE sys.sp_cdc_get_captured_columns
87-
@capture_instance = N'HumanResources_Employee';
86+
EXECUTE sys.sp_cdc_get_captured_columns @capture_instance = N'HumanResources_Employee';
8887
GO
8988
```
9089

docs/relational-databases/system-stored-procedures/sys-sp-cdc-get-ddl-history-transact-sql.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Returns the data definition language (DDL) change history associat
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/21/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -81,8 +81,7 @@ GO
8181
WAITFOR DELAY '00:00:10';
8282
GO
8383

84-
EXECUTE sys.sp_cdc_get_ddl_history
85-
@capture_instance = 'HumanResources_Employee';
84+
EXECUTE sys.sp_cdc_get_ddl_history @capture_instance = 'HumanResources_Employee';
8685
GO
8786
```
8887

docs/relational-databases/system-stored-procedures/sys-sp-cdc-help-jobs-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Reports information about all change data capture cleanup or captu
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 08/22/2024
7+
ms.date: 06/23/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -63,7 +63,7 @@ The following example returns information about the defined capture and cleanup
6363
USE AdventureWorks2022;
6464
GO
6565

66-
EXEC sys.sp_cdc_help_jobs;
66+
EXECUTE sys.sp_cdc_help_jobs;
6767
GO
6868
```
6969

0 commit comments

Comments
 (0)