Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2012 Change Data Capture Error 14234

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.

like image 317
Crove Shadowhirn Avatar asked Dec 24 '22 21:12

Crove Shadowhirn


1 Answers

As listed here, check the names match

SELECT srvname AS OldName FROM master.dbo.sysservers
SELECT SERVERPROPERTY('ServerName') AS NewName

If not, fix with:

sp_dropserver '<oldname>';  
GO  
sp_addserver '<newname>', local;  
GO  
like image 178
Dave Glassborow Avatar answered Jan 06 '23 18:01

Dave Glassborow