Wednesday, 16 December 2015

SQL CDC Error

When trying to enable the CDC on SQL database, the following error message displays:
  • Could not update the metadata that indicates database is enabled for Change Data Capture. The failure occurred when executing the command SetCDCTracked (Value = 1)

This error message comes when trying to enable CDC on a SQL Server 2008 database when the owner is not "sa".The fix for this is to change the database owner to "sa" by executing the below script:
  • USE <database-name>
  • GO
  • EXEC sp_changedbowner 'sa'



No comments:

SQL: Generate a range of numbers

SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n FROM       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),      (VALU...