sp_add_targetservergroup (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Adds the specified server group.

Topic link icon 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 cannot contain commas.

Return Code Values

0 (success) or 1 (failure)

Result Sets

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

Only members of the sysadmin fixed server role can execute this procedure.

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  

See Also

sp_apply_job_to_targets (Transact-SQL)
sp_delete_targetservergroup (Transact-SQL)
sp_help_targetservergroup (Transact-SQL)
sp_update_targetservergroup (Transact-SQL)
System Stored Procedures (Transact-SQL)