Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 2.54 KB

sp-changedistributiondb-transact-sql.md

File metadata and controls

80 lines (57 loc) · 2.54 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_changedistributiondb (Transact-SQL)
sp_changedistributiondb changes the properties of the distribution database.
markingmyname
maghan
randolphwest
07/05/2024
sql
replication
reference
sp_changedistributiondb_TSQL
sp_changedistributiondb
sp_changedistributiondb
TSQL

sp_changedistributiondb (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Changes the properties of the distribution database. This stored procedure is executed at the Distributor on any database.

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

Syntax

sp_changedistributiondb
    [ @database = ] N'database'
    [ , [ @property = ] N'property' ]
    [ , [ @value = ] N'value' ]
[ ; ]

Arguments

[ @database = ] N'database'

The name of the distribution database. @database is sysname, with no default.

[ @property = ] N'property'

The property to change for the given database. @property is sysname, and can be one of these values.

Value Description
history_retention History table retention period.
max_distretention Maximum distribution retention period.
min_distretention Minimum distribution retention period.
NULL (default) All available @property values are printed.

[ @value = ] N'value'

The new value for the specified property. @value is nvarchar(255), with a default of NULL.

Return code values

0 (success) or 1 (failure).

Remarks

sp_changedistributiondb is used in all types of replication.

Examples

:::code language="sql" source="../replication/codesnippet/tsql/sp-changedistributiondb-_1.sql":::

Permissions

Only members of the sysadmin fixed server role can execute sp_changedistributiondb.

Related content