I am having problems setting up change data capture on a SQL Server 2012 instance. Whenever I attempt to enable CDC on a table I get the following error:
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 [database name] 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.
The name of the server has not changed, I tried the sp_dropserver
/ sp_addserver
solution and receive the following error:
Msg 15015, Level 16, State 1, Procedure sp_dropserver, Line 42
The server 'ServerName' does not exist. Use sp_helpserver to show available servers.
Msg 15028, Level 16, State 1, Procedure sp_addserver, Line 74
The server 'ServerName' already exists.
As I've stated, I'm trying to set up CDC and not replication. The version of SQL Server is: 11.0.5058.0 (SQL Server 2012 SP2)
I've looked at Error while enabling CDC on table level and tried that solution.
I've also tried:
exec sys.sp_cdc_add_job @job_type = N'capture'
I receive the following error:
Msg 22836, Level 16, State 1, Procedure sp_cdc_add_job_internal, Line 282
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.
Any help would be greatly appreciated.
6条答案
按热度按时间bbmckpt71#
As listed here, check the names match
If not, fix with:
k2arahey2#
The error is caused due to mismatch in value between SERVERPROPERTY(‘ServerName’)) and master.dbo.sysservers
snvhrwxg3#
Check these SQLs:
If your
SERVERPROPERTY('ServerName')
is not any of thesysservers
, then the fix is to change your computer name to match one of those.6jjcrrmo4#
Adding the server fixes the issue:
ktca8awb5#
I had a similar situation, where I have restored a bak file which I got from another windows machine,which retained windows user account with the old PC name. I had delete the backup, create an empty data base and restore into that. This solved my issue
cl25kdpy6#
Query the following database table:
Clean all entries in that instance: