Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:12:40+00:00 2026-06-04T20:12:40+00:00

I have enabled CDC on few tables in my SQL server 2008 database. I

  • 0

I have enabled CDC on few tables in my SQL server 2008 database. I want to change the number of days I can keep the change history.

I have read that by default change logs are kept for 3 days, before they are deleted by sys.sp_cdc_cleanup_change_table stored proc.

Does anyone know how I can change this default value, so that I can keep the logs for longer.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:12:41+00:00Added an answer on June 4, 2026 at 8:12 pm

    You need to update the cdc_jobs.retention field for your database. The record in the cdc_jobs table won’t exist until at least one table has been enabled for CDC.

    -- modify msdb.dbo.cdc_jobs.retention value (in minutes) to be the length of time to keep change-tracked data
    update
        j
    set
        [retention] = 3679200 -- 7 years
    from
        sys.databases d
    inner join
        msdb.dbo.cdc_jobs j
            on j.database_id = d.database_id
            and j.job_type = 'cleanup'
            and d.name = '<Database Name, sysname, DatabaseName>';
    

    Replace <Database Name, sysname, DatabaseName> with your database name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was testing out the SQL Server 2008 change data capture feature on a
We have a SQL Server 2005 database, and currently all our users are connecting
I have enabled the Web Server on my Mac OS X (10.5.6) by going
In my server I have enabled the cURL module, I am even using some
I have enabled appstats for my Python App Engine application, and I can access
I have enabled form authentication in my ASP.NET MVC web application. I want to
I have enabled OpenId for my website. However when I want to download and
Hey guys I have enabled APC on my VPS but now I can't access
I have read that enabling Change Data Capture obviously has an impact on database
I have enabled sfDoctrineGuardPlugin, so I have change myUser class to my class extends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.