sp_get_redirected_publisher (Transact-SQL)
TOC
Collapse the table of content
Expand the table of content

sp_get_redirected_publisher (Transact-SQL)

 

Applies To: SQL Server

Used by replication agents to query a distributor to determine whether the original publisher has been redirected.

Topic link icon Transact-SQL Syntax Conventions

  
sp_get_redirected_publisher   
    [ @original_publisher = ] 'original_publisher',  
    [ @publisher_db = ] 'database_name',   
    [ @bypass_publisher_validation = ] [0 | 1 ]  

[ @original_publisher = ] 'original_publisher'
The name of the database being published. publisher_db is sysname, with no default.

[ @publisher_db = ] 'publisher_db'
The name of the database being published. publisher_db is sysname, with no default.

[ @bypass_publisher_validation = ] [0 | 1 ]
Used to bypass validation of the redirected publisher. If 0, validation is performed . If 1, validation is not performed. bypass_publisher_validation is bit, with a default of 0.

0 (success) or 1 (failure)

Column nameData typeDescription
redirected_publishersysnameThe name of the publisher after redirection.
error_numberintThe error number of the validation error.
error_severityintThe severity of the validation error.
error_messagenvarchar(4000)The text of the validation error message.

redirected_publisher returns the current publisher name. Returns null if the publisher and publishing databases have not been redirected using sp_redirect_publisher.

If validation is not requested or if no entry exists for the publisher and the publishing database, error_number and error_severity return 0 and error_message returns null.

If validation is requested, the validation stored procedure sp_validate_redirected_publisher (Transact-SQL) is called to verify that the target of the redirection is a suitable host for the publishing database. If the validation succeeds, sp_get_redirected_publisher returns the redirected publisher name, 0 for the error_number and error_severity columns, and null in the error_message column.

If validation is requested and fails, the redirected publisher name is returned along with error information.

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.

Replication Stored Procedures (Transact-SQL)
sp_validate_redirected_publisher (Transact-SQL)
sp_redirect_publisher (Transact-SQL)
sp_validate_replica_hosts_as_publishers (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft