Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2 KB

sp-add-targetservergroup-transact-sql.md

File metadata and controls

74 lines (52 loc) · 2 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_add_targetservergroup (Transact-SQL)
Adds the specified server group.
markingmyname
maghan
randolphwest
06/02/2023
sql
system-objects
reference
sp_add_targetservergroup
sp_add_targetservergroup_TSQL
sp_add_targetservergroup
TSQL

sp_add_targetservergroup (Transact-SQL)

[!INCLUDE SQL Server]

Adds the specified server group.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_add_targetservergroup [ @name = ] 'name'
[ ; ]

Arguments

[ @name = ] 'name'

The name of the server group to create. @name is sysname, with no default. @name can't contain commas.

Return code values

0 (success) or 1 (failure).

Result set

None.

Remarks

Target server groups provide an easy way to target a job at a collection of target servers. For more information, see sp_apply_job_to_targets.

Permissions

[!INCLUDE msdb-execute-permissions]

Examples

The following example creates the target server group named Servers Processing Customer Orders.

USE msdb;
GO

EXEC dbo.sp_add_targetservergroup 'Servers Processing Customer Orders';
GO

Related content