Udostępnij za pośrednictwem


sp_helpreplicationdboption (Transact-SQL)

Shows whether databases at the Publisher are enabled for replication. This stored procedure is executed at the Publisher on any database. Not supported for Oracle Publishers.

Topic link iconTransact-SQL Syntax Conventions

Syntax

sp_helpreplicationdboption [ [ @dbname =] 'dbname' ]
    [ , [ @type = ] 'type' ]
    [ , [ @reserved = ] reserved ]

Arguments

  • [ @dbname=] 'dbname'
    Is the name of the database. dbname is sysname, with a default of %. If %, then the result set contains all databases at the Publisher, otherwise only information on the specified database is returned. Information is not returned for any databases on which the user does not have the appropriate permissions, as described below.
  • [ @type=] 'type'
    Restricts the result set to contain only databases on which the specified replication option type value has been enabled. type is sysname, and can be one of the following values.

    Value Description

    publish

    Transactional replication allowed.

    merge publish

    Merge replication allowed.

    replication allowed (default)

    Either transactional or merge replication allowed.

  • [ @reserved= ] reserved
    Specifies whether information on existing publications and subscriptions is returned. reserved is bit, with a default value of 0. If 1, the result set includes information on whether the database specified has any existing publications or subscriptions.

Return Code Values

0 (success) or 1 (failure)

Result Sets

Column name Data type Description

name

sysname

Name of the database.

id

int

Database identifier.

transpublish

bit

If the database has been enabled for snapshot or transactional publishing; where a value of 1 means that snapshot or transactional publishing is enabled.

mergepublish

bit

If the database has been enabled for merge publishing; where a value of 1 means that merge publishing is enabled.

dbowner

bit

If the user is a member of the db_owner fixed database role; where a value of 1 indicates that the user is a member of this role.

dbreadonly

bit

Is if the database is marked as read-only; where a value of 1 means that the database is read-only.

haspublications

bit

Is if the database has any existing publications; where a value of 1 means that there are existing publications.

haspullsubscriptions

bit

Is if the database has any existing pull subscriptions; where a value of 1 means that there are existing pull subscriptions.

Remarks

sp_helpreplicationdboption is used in snapshot, transactional, and merge replication.

Permissions

Members of the sysadmin fixed server role can execute sp_helpreplicationdboption for any database. Members of the db_owner fixed database role can execute sp_helpreplicationdboption for that database.

See Also

Reference

sp_replicationdboption (Transact-SQL)
System Stored Procedures (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance