SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Change data capture retentioni
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

612 Posts

Posted - 11/26/2012 :  15:11:17  Show Profile  Reply with Quote
I would like to retain the data for change data capture log tables to 365 days.
Please let me know the calculation for the retention period for 365 days in the below script.

EXECUTE sys.sp_cdc_change_job
@job_type = N'cleanup',
@retention =; --for 365 days

and also after applying the script how to know it is been updated the retention period to 356 days.

Thanks for your help in advance..

Starting Member

16 Posts

Posted - 11/30/2012 :  06:41:21  Show Profile  Reply with Quote
As far as retention value in 'sys.sp_cdc_change_job' is shown as number of minutes. you can calculate it accordingly.

Data from Microsoft Technet Document:
[ @retention ] =retention
Number of minutes that change rows are to be retained in change tables. retention is bigint with a default of NULL, which indicates no change for this parameter. The maximum value is 52494800 (100 years). If specified, the value must be a positive integer.

retention is valid only for cleanup jobs.

For your script it could be like this:
EXECUTE sys.sp_cdc_change_job
@job_type = N'cleanup',
@retention =525600;

And you can see this changes in 'msdb.dbo.cdc_jobs'

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000