次の方法で共有


sp_changesubscriber (Transact-SQL)

適用対象: SQL Server Azure SQL Managed Instance

サブスクライバーのオプションを変更します。 このパブリッシャーのサブスクライバーに対するディストリビューション タスクはすべて更新されます。 このストアド プロシージャは、ディストリビューション データベースの MSsubscriber_info テーブルに書き込みます。 このストアド プロシージャは、パブリッシャー側のパブリケーション データベースで実行されます。

Transact-SQL 構文表記規則

構文

  
sp_changesubscriber [ @subscriber= ] 'subscriber'  
    [ , [ @type= ] type ]  
    [ , [ @login= ] 'login' ]  
    [ , [ @password= ] 'password' ]  
    [ , [ @commit_batch_size= ] commit_batch_size ]  
    [ , [ @status_batch_size= ] status_batch_size ]  
    [ , [ @flush_frequency= ] flush_frequency ]  
    [ , [ @frequency_type= ] frequency_type ]  
    [ , [ @frequency_interval= ] frequency_interval ]  
    [ , [ @frequency_relative_interval= ] frequency_relative_interval ]  
    [ , [ @frequency_recurrence_factor= ] frequency_recurrence_factor ]  
    [ , [ @frequency_subday= ] frequency_subday ]  
    [ , [ @frequency_subday_interval= ] frequency_subday_interval ]  
    [ , [ @active_start_time_of_day= ] active_start_time_of_day ]  
    [ , [ @active_end_time_of_day= ] active_end_time_of_day ]  
    [ , [ @active_start_date= ] active_start_date ]  
    [ , [ @active_end_date= ] active_end_date ]  
    [ , [ @description= ] 'description' ]  
    [ , [ @security_mode= ] security_mode ]  
    [ , [ @publisher = ] 'publisher' ]  

引数

[ @subscriber = ] 'subscriber' オプションを変更するサブスクライバーの名前を指定します。 subscribersysname で、既定値はありません。

[ @type = ] type サブスクライバーの種類です。 typetinyint で、既定値は NULL です。 0 は、Microsoft SQL Server サブスクライバーを示します。 1 SQL Server 以外または他の ODBC データ ソース サーバー サブスクライバーを指定します。

[ @login = ] 'login' SQL Server 認証ログイン ID です。 loginsysname で、既定値は NULL です。

[ @password = ] 'password' SQL Server 認証パスワードです。 passwordsysname で、既定値は % です。 % は、パスワード プロパティに変更がないことを示します。

[ @commit_batch_size = ] commit_batch_size 下位互換性のためにのみサポートされます。

[ @status_batch_size = ] status_batch_size 下位互換性のためにのみサポートされます。

[ @flush_frequency = ] flush_frequency 下位互換性のためにのみサポートされます。

[ @frequency_type = ] frequency_type 配布タスクをスケジュールする頻度を指定します。 frequency_typeint であり、これらの値のいずれかを指定できます。

Value 説明
1 指定日時
2 オン デマンド
4 毎日
8 週次
16 月ごと
32 月単位の相対
64 自動開始
128 定期的

[ @frequency_interval = ] frequency_intervalfrequency_typeの間隔です。 frequency_intervalint で、既定値は NULL です。

[ @frequency_relative_interval = ] frequency_relative_interval 配布タスクの日付を指定します。 このパラメーターは、 frequency_type32 (月単位の相対値) に設定されている場合に使用されます。 frequency_relative_intervalint であり、これらの値のいずれかを指定できます。

Value 説明
1 最初
2 Second
4 Third
8 4 番目
16 最後

[ @frequency_recurrence_factor = ] frequency_recurrence_factor 定義された frequency_type中に配布タスクを繰り返す頻度を指定します。 frequency_recurrence_factorint で、既定値は NULL です。

[ @frequency_subday = ] frequency_subday 定義された期間中にスケジュールを変更する頻度を指定します。 frequency_subdayint であり、これらの値のいずれかを指定できます。

Value 説明
1 1 回。
2 Second
4
8 時間

[ @frequency_subday_interval = ] frequency_subday_intervalfrequence_subdayの間隔です。 frequency_subday_intervalint で、既定値は NULL です。

[ @active_start_time_of_day = ] active_start_time_of_day 配布タスクが最初にスケジュールされた時刻で、 HHmmss形式です。 active_start_time_of_dayint で、既定値は NULL です。

[ @active_end_time_of_day = ] active_end_time_of_day 配布タスクのスケジュールが終了した時刻を HHmmss形式で指定します。 active_end_time_of_dayint で、既定値は NULL です。

[ @active_start_date = ] active_start_date 配布タスクが最初にスケジュールされた日付を yyyyMMdd形式で指定します。 active_start_dateint で、既定値は NULL です。

[ @active_end_date = ] active_end_date 配布タスクのスケジュールが終了した日付を yyyyMMdd形式で指定します。 active_end_dateint。既定値は NULL です。

[ @description = ] 'description' 省略可能なテキストの説明です。 descriptionnvarchar(255)で、既定値は NULL です。

[ @security_mode = ] security_mode 実装されているセキュリティ モードです。 security_modeint であり、これらの値のいずれかを指定できます。

Value 説明
0 SQL Server 認証
1 Windows 認証

[ @publisher = ] 'publisher' SQL Server 以外のパブリッシャーを指定します。 publishersysname で、既定値は NULL です。

Note

パブリッシャー は、SQL Server パブリッシャーのアーティクルのプロパティを変更するときに使用しないでください。

リターン コードの値

0 (成功) または 1 (失敗)

解説

sp_changesubscriber は、すべての種類のレプリケーションで使用されます。

アクセス許可

sysadmin固定サーバー ロールのメンバーのみがsp_changesubscriberを実行できます。

参照

sp_addsubscriber (Transact-SQL)
sp_dropsubscriber (Transact-SQL)
sp_helpdistributiondb (Transact-SQL)
sp_helpserver (Transact-SQL)
sp_helpsubscriberinfo (Transact-SQL)
システム ストアド プロシージャ (Transact-SQL)