sp_helpdistributor (Transact-SQL)

列出有关分发服务器、分发数据库、工作目录和 Microsoft SQL Server 代理用户帐户的信息。该存储过程在发布服务器上对发布数据库或任何数据库执行。

主题链接图标Transact-SQL 语法约定

语法

sp_helpdistributor [ [ @distributor= ] 'distributor' OUTPUT ]
    [ , [ @distribdb= ] 'distribdb' OUTPUT ]
    [ , [ @directory= ] 'directory' OUTPUT ]
    [ , [ @account= ] 'account' OUTPUT ]
    [ , [ @min_distretention= ] min_distretention OUTPUT ]
    [ , [ @max_distretention= ] max_distretention OUTPUT ]
    [ , [ @history_retention= ] history_retention OUTPUT ]
    [ , [ @history_cleanupagent= ] 'history_cleanupagent' OUTPUT ]
    [ , [ @distrib_cleanupagent = ] 'distrib_cleanupagent' OUTPUT ]
    [ , [ @publisher = ] 'publisher' ] 
    [ , [ @local = ] 'local' ]
    [ , [ @rpcsrvname= ] 'rpcsrvname' OUTPUT ]
    [ , [ @publisher_type = ] 'publisher_type' OUTPUT ]

参数

  • [ @distributor=] 'distributor' OUTPUT
    分发服务器的名称。Distributor 的数据类型为 sysname,默认值为 %,该值是返回结果集的唯一值。
  • [ @distribdb=] 'distribdb' OUTPUT
    分发数据库的名称。distribdb 的数据类型为 sysname,默认值为 %,该值是返回结果集的唯一值。
  • [ @directory=] 'directory' OUTPUT
    工作目录。directory 的数据类型为 nvarchar(255),默认值为 %,该值是返回结果集的唯一值。
  • [ @account=] 'account' OUTPUT
    Microsoft Windows 用户帐户。accountnvarchar(255),默认值为 %,该值是返回结果集的唯一值。
  • [ @min_distretention=] min_distretentionOUTPUT
    以小时为单位的最小分发保持期。min_distretention 的数据类型为 int,默认值为 -1
  • [ @max_distretention=] max_distretentionOUTPUT
    以小时为单位的最大分发保持期。max_distretention 的数据类型为 int,默认值为 -1
  • [ @history_retention=] history_retentionOUTPUT
    以小时为单位的历史记录保持期。history_retention 的数据类型为 int,默认值为 -1
  • [ @history_cleanupagent=] 'history_cleanupagent' OUTPUT
    历史记录清除代理的名称。history_cleanupagent 的数据类型为 nvarchar(100),默认值为 %,该值是返回结果集的唯一值。
  • [ @distrib_cleanupagent =] 'distrib_cleanupagent' OUTPUT
    分发清除代理的名称。distrib_cleanupagent 的数据类型为 nvarchar(100),默认值为 %,该值是返回结果集的唯一值。
  • [ @publisher=] 'publisher'
    发布服务器的名称。publisher 的数据类型为 sysname,默认值为 NULL。
  • [ @local=] 'local'
    指示 SQL Server 是否应获得本地服务器值。local 的数据类型为 nvarchar(5),默认值为 NULL。
  • [ @rpcsrvname=] 'rpcsrvname' OUTPUT
    发出远程过程调用的服务器的名称。rpcsrvname 的数据类型为 sysname,默认值为 %,该值是返回结果集的唯一值。
  • [ @publisher_type= ] 'publisher_type' OUTPUT
    发布服务器的发布服务器类型。publisher_type 的数据类型为 sysname,默认值为 %,该值是返回结果集的唯一值。

返回代码值

0(成功)或 1(失败)

结果集

列名 数据类型 说明

distributor

sysname

分发服务器的名称。

分发数据库 (distribution database)

sysname

分发数据库的名称。

directory

nvarchar(255)

工作目录的名称。

帐户

nvarchar(255)

Windows 用户帐户的名称。

min distrib retention

int

最小分发保持期。

max distrib retention

int

最大分发保持期。

history retention

int

历史记录保持期。

history cleanup agent

nvarchar(100)

历史记录清除代理的名称。

distribution cleanup agent

nvarchar(100)

分发清除代理的名称。

rpc server name

sysname

远程分发服务器或本地分发服务器的名称。

rpc login name

sysname

用于对远程分发服务器的远程过程调用的登录名。

publisher type

sysname

发布服务器的类型;可以为下列值之一:

MSSQLSERVER

ORACLE

ORACLE GATEWAY

备注

sp_helpdistributor 用于所有类型的复制。

如果在执行 sp_helpdistributor 时指定了一个或多个输出参数,则在退出时将为设置为 NULL 的所有参数分配值,并且不返回结果集。如果未指定输出参数,则返回结果集。

权限

以下结果集列或输出参数返回给发布服务器上的 sysadmin 固定服务器角色的成员和发布数据库上的 db_owner 固定数据库角色的成员:

结果集列 输出参数

帐户

@account

min distrib retention

@min_distretention

max distrib retention

@max_distretention

history retention

@history_retention

history cleanup agent

@history_cleanupagent

distribution cleanup agent

@distrib_cleanupagent

rpc login name

none

以下结果集列返回给分发服务器上的某个发布的发布访问列表中的用户:

  • directory

以下结果集列返回给所有用户。

结果集列 输出参数

distributor

@distributor

分发数据库 (distribution database)

@distribdb

rpc server name

@rpcsrvname

publisher type

@publisher_type

请参阅

参考

sp_adddistpublisher (Transact-SQL)
sp_dropdistpublisher (Transact-SQL)

其他资源

How to: View and Modify Publisher and Distributor Properties (Replication Transact-SQL Programming)

帮助和信息

获取 SQL Server 2005 帮助