共用方式為


如何:檢視和修改發送訂閱屬性 (複寫 Transact-SQL 程式設計)

您可以使用複寫預存程序來以程式設計的方式修改發送訂閱及存取其屬性。使用哪些預存程序要依訂閱所屬的發行集類型而定。

檢視快照式或交易式發行集之發送訂閱的屬性

  1. 在發行集資料庫的發行者上,執行 sp_helpsubscription。指定 @publication@subscriber,並針對 @article 指定 all 的值。

  2. 在發行集資料庫的發行者上,執行 sp_helpsubscriberinfo,並指定 @subscriber

變更快照式或交易式發行集之發送訂閱的屬性

  1. 在發行集資料庫的發行者上,執行 sp_changesubscriber,並指定 @subscriber 及針對所變更的訂閱者屬性指定任何參數。

  2. 在發行集資料庫的發行者上,執行 sp_changesubscription。指定 @publication@subscriber@destination_db,並將 @article 指定為 all 的值、將變更的訂閱屬性指定為 @property,並將新的值指定為 @value。這樣會變更發送訂閱的安全性設定。

  3. (選擇性) 若要變更訂閱的 Data Transformation Services (DTS) 封裝屬性,請在訂閱資料庫的訂閱者上,執行 sp_changesubscriptiondtsinfo。針對 @jobid 指定散發代理程式作業的識別碼以及下列 DTS 封裝屬性:

    • @dts_package_name

    • @dts_package_password

    • @dts_package_location

    這樣會變更訂閱的 DTS 封裝屬性。

    [!附註]

    可以執行 sp_helpsubscription 來取得作業識別碼。

檢視合併式發行集之發送訂閱的屬性

  1. 在發行集資料庫的發行者上,執行 sp_helpmergesubscription。指定 @publication@subscriber

  2. 在發行者端,執行 sp_helpsubscriberinfo,指定 @subscriber

變更合併式發行集之發送訂閱的屬性

  • 在發行集資料庫的發行者上,執行 sp_changemergesubscription。指定 @publication@subscriber@subscriber_db、將變更的訂閱屬性指定為 @property,並將新值指定為 @value