5

I have change tracking enabled on a SQL Server database. I originally configured the database to use auto cleanup with a retention period of 3 days. Now that everything is running I would like to update that retention window to 10 days. How can I do that using a SQL statement? I don't want to turn off change tracking and reconfigure.

BenR
  • 11,296
  • 3
  • 28
  • 47

1 Answers1

7

The documentation on this isn't very clear and the syntax is a little unusual. The easiest way to do this outside of SSMS is to issue this statement:

ALTER DATABASE CURRENT SET CHANGE_TRACKING (CHANGE_RETENTION = 10 DAYS)
BenR
  • 11,296
  • 3
  • 28
  • 47