sp_changesubscriber (Transact-SQL)
更改订阅服务器的选项。 更新针对此发布服务器的订阅服务器的任何分发任务。 此存储过程写入 分发数据库中MSsubscriber_info 表。 此存储过程在发布服务器上对发布数据库执行。
语法
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'
要更改选项的订阅服务器的名称。 订阅服务器 为 sysname,无默认值。
[ @type = ] type
订阅服务器类型。 类型 为 tinyint,默认值为 NULL。 0 指示 Microsoft SQL Server 订阅服务器。 1 指定非 SQL Server 或其他 ODBC 数据源服务器订阅服务器。
[ @login = ] 'login'
SQL Server 身份验证登录 ID。 login 为 sysname,默认值为 NULL。
[ @password = ] 'password'
SQL Server 身份验证密码。 password 为 sysname,默认值为 %. % 指示密码属性没有更改。
[ @commit_batch_size = ] commit_batch_size
仅支持向后兼容性。
[ @status_batch_size = ] status_batch_size
仅支持向后兼容性。
[ @flush_frequency = ] flush_frequency
仅支持向后兼容性。
[ @frequency_type = ] frequency_type
计划分发任务的频率。 frequency_type 为 int,可以是以下值之一。
值 | 说明 |
---|---|
1 | 一次 |
2 | 按需 |
4 | 每日 |
8 | 每周 |
16 | 每月 |
32 | 与“每月”选项相关 |
64 | 自动启动 |
128 | 定期 |
[ @frequency_interval = ] frequency_interval
frequency_type的间隔。 frequency_interval为 int,默认值为 NULL。
[ @frequency_relative_interval = ] frequency_relative_interval
分发任务的日期。 当frequency_type设置为 32(每月相对)时,将使用此参数。 frequency_relative_interval 为 int,可以是以下值之一。
值 | 说明 |
---|---|
1 | 第一个 |
2 | Second |
4 | 第三个 |
8 | 第四 |
16 | Last |
[ @frequency_recurrence_factor = ] frequency_recurrence_factor
在定义的 frequency_type期间,分发任务应递归的频率。 frequency_recurrence_factor为 int,默认值为 NULL。
[ @frequency_subday = ] frequency_subday
在定义的时间段内重新安排的频率。 frequency_subday为 int,可以是其中一个值。
值 | 说明 |
---|---|
1 | 一次 |
2 | Second |
4 | Minute |
8 | 小时 |
[ @frequency_subday_interval = ] frequency_subday_interval
frequence_subday的间隔。 frequency_subday_interval为 int,默认值为 NULL。
[ @active_start_time_of_day = ] active_start_time_of_day
第一次计划分发任务的时间,格式为 HHmmss
。 active_start_time_of_day为 int,默认值为 NULL。
[ @active_end_time_of_day = ] active_end_time_of_day
分发任务停止计划的时间,格式为 HHmmss
. active_end_time_of_day为 int,默认值为 NULL。
[ @active_start_date = ] active_start_date
首次计划分发任务的日期,格式为 yyyyMMdd
。 active_start_date 为 int,默认值为 NULL。
[ @active_end_date = ] active_end_date
分发任务停止计划的日期,格式为 yyyyMMdd
。 active_end_date为 int,默认值为 NULL。
[ @description = ] 'description'
可选文本说明。 description 为 nvarchar(255),默认值为 NULL。
[ @security_mode = ] security_mode
实现的安全模式。 security_mode为 int,可以是这些值之一。
值 | 说明 |
---|---|
0 | SQL Server 身份验证 |
1 | Windows 身份验证 |
[ @publisher = ] 'publisher'
指定非 SQL Server 发布服务器。 publisher 为 sysname,默认值为 NULL。
注意
更改 SQL Server 发布服务器上的项目属性时,不应使用 publisher 。
返回代码值
0 (成功) 或 1 (失败)
注解
sp_changesubscriber用于所有类型的副本 (replica)。
权限
只有 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)
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈