sp_redirect_publisher (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_redirect_publisher (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Specifies a redirected publisher for an existing publisher/database pair. If the publisher database belongs to an AlwaysOn Availability Group, the redirected publisher is the availability group listener name associated with the availability group.

Topic link icon Transact-SQL Syntax Conventions

    [ @original_publisher = ] 'original_publisher',
    [ @publisher_db = ] 'database_name' 
    [ , [ @redirected_publisher = ] 'new_publisher' ]

[ @original_publisher = ] 'original_publisher'

The name of the instance of SQL Server that originally published the database. original_publisher is sysname, with no default.

[ @publisher_db = ] 'publisher_db'

The name of the database being published. publisher_db is sysname, with no default.

[ @redirected_publisher = ] 'redirected_publisher'

The availability group listener name associated with the availability group that will be the new publisher. redirected_publisher is sysname, with no default. When the availability group listener is configured to non-default port, specify the port number along with listener name, such as 'Listenername,51433'

0 (success) or 1 (failure)

sp_redirect_publisher is used to allow a replication publisher to be redirected to the current primary of an AlwaysOn availability group by associating the publisher/database pair with an availability group’s listener. Execute sp_redirect_publisher after the AG listener has been configured for the availability group that contains the published database.

If the publication database at the original publisher is removed from an availability group at the primary replica, execute sp_redirect_publisher without specifying a value for the @redirected_publisher parameter to remove the redirection for the publisher/database pair. For more information about redirecting the publisher when, see Maintaining an AlwaysOn Publication Database (SQL Server).

Caller must either be a member of the sysadmin fixed server role, the db_owner fixed database role for the distribution database, or a member of a publication access list for a defined publication associated with the publisher database.

Community Additions

© 2016 Microsoft