Error while enabling CDC on table level

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

I am enabling Change data capture (CDC) on SQL server 2012 Enterprise edition(11.0.2100.60)

. I am able to enable it on Database level with below SQL, but failed to enable on Table level.

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 

Got Error like,

'msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 623

Could 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.'

Would anyone help me to out of this?

Thanks in advance..!!

回答1:

I had the same problem recently.

In my opinion, it is highly probable that the name of the computer has changed. If it is true, read on ...

Name Changing the computer is automatically recognized by SQL. However, system metadata must be updated manually. (Source: http://msdn.microsoft.com/en-us/library/ms143799.aspx)

SQL Statement

sp_dropserver old_name\instancename; GO sp_addserver new_name\instancename, local; GO 

Example

sp_dropserver name-PC\SQLEXPRESS; GO sp_addserver CLT55\SQLEXPRESS, local; GO 

Reference problem and solution (http://zavaschi.com/index.php/category/sql-server-2014/)



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!