我在SQL Server 2012企业版(11.0.2100.60)上启用了更改数据捕获(CDC)
.我可以在数据库级别上使用低于SQL启用它,但无法在表级别启用它.
Use DatabaseName
GO
Exec sys.sp_cdc_enable_db
GO
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo'
,@source_name = N'TableName'
, @role_name = NULL
GO
得到错误,
‘msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal,
Line 623Could not update the metadata that indicates table [dbo].[TableName]
is enabled for Change Data Capture. The failure occurred when
executing the command ‘[sys].[sp_cdc_add_job] @job_type = N’capture”.
The error returned was 22836: ‘Could not update the metadata for
database DatabaseName to indicate that a Change Data Capture job has
been added. The failure occurred when executing the command
‘sp_add_jobstep_internal’. The error returned was 14234: ‘The
specified ‘@server’ is invalid (valid values are returned by
sp_helpserver).’. Use the action and error to determine the cause of
the failure and resubmit the request.’. Use the action and error to
determine the cause of the failure and resubmit the request.’
有人会帮我解决这个问题吗?
提前致谢..!!
最佳答案 我最近遇到了同样的问题.
在我看来,很可能计算机的名称已经改变.
如果是真的,请继续阅读……
名称SQL自动识别更改计算机.但是,必须手动更新系统元数据.
(来源:http://msdn.microsoft.com/en-us/library/ms143799.aspx)
SQL语句
sp_dropserver old_name\instancename;
GO
sp_addserver new_name\instancename, local;
GO
例
sp_dropserver name-PC\SQLEXPRESS;
GO
sp_addserver CLT55\SQLEXPRESS, local;
GO
参考问题和解决方案
(http://zavaschi.com/index.php/category/sql-server-2014/)