PublicationAttributes Property
未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。
The PublicationAttributes property specifies available functions for a Microsoft SQL Server replication publication.
語法
object
.PublicationAttributes [= value]
Parts
object
An expression that evaluates to an object in the Applies To list.value
A long integer that specifies publication behaviors described in Settings.
Data Type
Long, enumerated
Modifiable
Read/write
Prototype (C/C++)
HRESULT GetPublicationAttributes(SQLDMO_PUBATTRIB_TYPE* pRetVal);
HRESULT SetPublicationAttributes(SQLDMO_PUBATTRIB_TYPE NewValue);
Settings
Set value using these SQLDMO_PUBATTRIB_TYPE values.
Constant |
Value |
Description |
---|---|---|
SQLDMOPubAttrib_AllowAnonymous |
4 |
Allows anonymous Subscriber-originated subscriptions against the referenced publication. |
SQLDMOPubAttrib_AllowPull |
2 |
Allows known Subscriber-originated (pull) subscriptions against the referenced publication. |
SQLDMOPubAttrib_AllowPush |
1 |
Allows the Publisher to force subscription to the publication. |
SQLDMOPubAttrib_/AllowSubscriptionCopy |
100 |
Allows copying and attaching of the subscription database to other Subscribers. |
SQLDMOPubAttrib_/CompressSnapshot |
128 |
Compresses snapshot files. |
SQLDMOPubAttrib_Default |
1 |
SQLDMOPubAttrib_AllowPush. |
SQLDMOPubAttrib_ImmediateSync |
16 |
Forces immediate synchronization of the referenced publication. |
SQLDMOPubAttrib_IndependentAgent |
32 |
Runs the agent as an independent agent. |
SQLDMOPubAttrib_InternetEnabled |
8 |
Enables the referenced publication for distribution across the Internet. |
SQLDMOPubAttrib_/SnapshotInDefaultFolder |
64 |
Keeps the snapshot copy in the default folder. |
SQLDMOPubAttrib_Unknown |
256 |
The referenced publication has an unknown attribute setting. |
SQLDMOPubAttrib_Valid |
511 |
A mask for valid attribute settings. |
備註
ThePublicationAttributes property is a bit-packed value that specifies one or more allowed functions. Combine values using the OR logical operator.
For a referenced, Subscriber-initiated subscription, PublicationAttributes is SQLDMOPubAttrib_Min until synchronization occurs and the Subscriber can determine the attributes.
To enable anonymous subscriptions, SQLDMOPubAttrib_AllowPull, SQLDMOPubAttrib_AllowAnonymous and SQLDMOPubAttrib_ImmediateSync must all be specified.
If the SQLDMOPubAttrib_InternetEnabled attribute is specified, the AltSnapshotFolder property must be specified. If the AltSnapshotFolder property is set to NULL or an empty string, SQLDMOPubAttrib_InternetEnabled is automatically turned off.
[!附註]
If an application sets PublicationAttributes with the MergePublicationor TransPublication object with a setting of SQLDMOPubAttrib_CompressSnapshot, SQLDMOPubAttrib_InternetEnabled, or SQLDMOPubAttrib_SnapshotInDefaultFolder after the initial snapshot has been created, a new snapshot must be generated and then reapplied to each subscription. Snapshots are applied when the next scheduled snapshot and distribution or merge agent run.
Applies To: