共用方式為


EnumPublications Method

未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。

The EnumPublications method returns a QueryResults object that enumerates the publications of a replication publishing data source.

語法

object.EnumPublications(Database ,ReplicationType ,AgentLogin ,bSecurityCheck)as QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Database
    String that identifies a replication database by name. Use % to specify all databases.

  • ReplicationType
    Long integer that specifies a replication method and restricts result set membership as specified in Settings.

  • AgentLogin
    String that identifies a Microsoft SQL Server login or an empty string.

  • bSecurityCheck
    TRUE or FALSE as described in Settings.

Prototype (C/C++)

HRESULT EnumPublications(LPSQLDMOQUERYRESULTS *ppResults,
SQLDMO_REPLICATION_TYPE ReplicationType = SQLDMORepType_TransactionalMerge
SQLDMO_LPCSTR DatabaseName = NULL,
SQLDMO_LPCSTR AgentLogin = NULL, BOOL bSecurityCheck = FALSE);

Settings

Set ReplicationType using these values.

Constant

Value

Description

SQLDMORepType_Merge

2

Result set enumerates merge replication publications.

SQLDMORepType_/Transactional

1

Result set enumerates transactional and snapshot replication publications.

SQLDMORepType_/TransactionalMerge

3

Result set enumerates all publications regardless of replication method.

When bSecurityCheck is TRUE, the method enumerates only publications accessible to the login used for SQLServerobject connection. The AgentLogin argument is evaluated.

When bSecurityCheck is FALSE (default), all publications are enumerated.

Returns

A QueryResults object that contains one result set defined by these columns.

Column

Data type

Description

agent_access

bit

When TRUE, the login specified in the AgentLogin argument is a member of the publication access list.

allow_anonymous

bit

When TRUE, anonymous subscriptions are allowed.

allow_pull

bit

When TRUE, Subscriber-originated (pull) subscriptions are allowed.

allow_sync_tran

bit

When TRUE, the transactional replication publication is updatable at the Subscriber.

description

nvarchar(256)

Descriptive text.

distribution_db

nvarchar(129)

Name of the distribution database.

enabled_for_internet

bit

When TRUE, publication allows snapshot download using FTP.

immediate_sync

bit

When TRUE, a synchronization exists for the publication.

immediate_sync_ready

bit

When TRUE, a synchronization snapshot exists for the publication.

independent_agent

bit

TRUE for merge replication publications.

publication

nvarchar(129)

Publication name.

publisher

nvarchar(129)

Name of the data source publishing the data.

publisher_db

nvarchar(129)

Database name.

repl_freq

tinyint

Frequency used to replicate data. Interpret value using SQLDMO_REPFREQ_TYPE.

replication_type

tinyint

Replication method. Interpret value using SQLDMO_REPLICATION_TYPE.

thirdparty_flag

bit

When TRUE, the publication source is not an instance of SQL Server 2000.

vendor_name

nvarchar(129)

Name of the vendor of the product publishing the data.

Applies To:

請參閱

參考