Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Change Tracking on Shadow Database

Ermias Tefera Feb 05, 2015 02:55AM AEDT

Hi,
I keep getting an error when i tried to refresh in ReadyRollDBSync
at the step "Ensuring Shadow Database is up-to-date".
My database uses Change tracking in for its tables.

Here is the error

"Change Tracking must be enabled on database '[MyDatabaseName_Administrator_SHADOW]' before it can be enabled on the table 'MyTableName'"

Here the table "MyTableName" is a table that will have a change tracking enabled to,and it have a sql script generated in Deploy-Once Folder.

I'm using Visual Studio 2012 and MS-SQLServer 2012

Any help?
Thanks

Up 1 rated Down
Daniel Nolan Feb 05, 2015 06:10PM AEDT ReadyRoll Agent

Hi Ermias,

Sorry to hear you’ve run into a problem there building your Shadow database.

As unfortunately ReadyRoll doesn’t automatically script database-level properties, like whether Change Tracking is enabled, you’ll need to add this as a Pre-Deployment script action. To do so, add a new script under the projects Pre-Deployment folder, e.g.

<ProjectRoot>\Pre-Deployment\02_Enable_ChangeTracking.sql

And include logic to (conditionally) enable change tracking on the database, for example:

IF NOT EXISTS (SELECT * FROM sys.change_tracking_databases WHERE database_id=DB_ID(‘$(DatabaseName)’))
BEGIN
PRINT ‘Enabling change tracking in $(DatabaseName)…’;
ALTER DATABASE [$(DatabaseName)] SET CHANGE_TRACKING = ON;
END
GO

In future, we hope to automate the scripting of such properties. I hope this helps for the moment, however.

Best Regards,

Daniel
Up 0 rated Down
Daniel Nolan Feb 05, 2015 06:43PM AEDT ReadyRoll Agent

Great to hear, Ermias! Thanks for letting us know.

Up 0 rated Down
Ermias Tefera Feb 21, 2015 02:31PM AEDT
Thanks Daniel,it is working.

This question has received the maximum number of answers.

readyroll.support@red-gate.com
http://assets0.desk.com/
false
readyrollsql
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete