SQL Server 2012 Change Data Capture Error 14234
Asked Answered
C

6

7

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.

Charlacharlady answered 13/3, 2015 at 13:38 Comment(3)
Ensure the SQL Server Agent is running.Carnet
SQL Agent is up and runningCharlacharlady
Have you found any solution? I am facing the same problemJuta
R
12

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  
Rockweed answered 24/8, 2018 at 10:53 Comment(0)
R
2

The error is caused due to mismatch in value between SERVERPROPERTY(‘ServerName’)) and master.dbo.sysservers

Russom answered 1/7, 2015 at 19:33 Comment(0)
S
1

Check these SQLs:

SELECT * FROM master.dbo.sysservers
SELECT SERVERPROPERTY('ServerName')

If your SERVERPROPERTY('ServerName') is not any of the sysservers, then the fix is to change your computer name to match one of those.

Swihart answered 23/8, 2015 at 7:21 Comment(0)
K
1

Adding the server fixes the issue:

DECLARE @ServerName NVARCHAR(128) = CONVERT(sysname, SERVERPROPERTY('servername'));
EXEC sp_addserver @ServerName, 'local';
GO
Kenlee answered 6/5, 2016 at 20:14 Comment(0)
A
0

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

Absorbance answered 26/5, 2017 at 7:51 Comment(0)
B
0

Query the following database table:

select * from msdb.dbo.cdc_jobs;

Clean all entries in that instance:

delete from msdb.dbo.cdc_jobs where database_id='<database_id>';
Bondsman answered 6/11, 2023 at 14:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.