Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not update the metadata that indicates database X is enabled for Change Data Capture. The error returned was 15517

I use SQL Server 2008 and AdventureWorkDB.

I want enable Change Data Capture in my database.

I execute this command :

USE [AdventureWorksDB];
GO
EXEC sys.sp_cdc_enable_db ;

But i get this error :

Could not update the metadata that indicates database X is enabled for 
Change Data Capture. 
The failure occurred when executing the command 'SetCDCTracked(Value = 1)'. 
The error returned was 15517: 
    'Cannot execute as the database principal because 
     the principal "dbo" does not exist, 
     this type of principal cannot be impersonated, 
     or you do not have permission.'. 
Use the action and error to determine the cause of the failure and resubmit 
the request. 

How I can fix it ?

like image 344
Ardalan Shahgholi Avatar asked Dec 07 '13 13:12

Ardalan Shahgholi


1 Answers

After googling

I fix it with this command :

EXEC sp_changedbowner 'sa'

I must add DataBase owner to my database.

like image 84
Ardalan Shahgholi Avatar answered Nov 01 '22 13:11

Ardalan Shahgholi