SQL Compare and SQL Source Control - Database not linked

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

SQL Compare and SQL Source Control - Database not linked

Postby instalectual » Thu Sep 19, 2013 7:44 pm

Hi,

I am receiving the following error when cruisecontrol executes my database build scripts:

Unexpected error: The database <dbName> is not linked to SQL Source Control

The scripts work perfectly when I execute them from the build server, but when cruisecontrol executes them we receive that error. While configuring this build process I was logged into the build terminal as myself and linked the database to SVN with SQL Source Control therefore it runs perfectly under my account. The issue seems to be that the cruisecontrol service runs under a service account and the db is not linked to SVN under that service account. Is there a way to make this work regardless of the account the service runs under. For example, is it possible to link a database to SVN for all users of a terminal?

A few things to note:
    It is not practical to run the cruisecontrol service under a non-service account for security reasons.
    It is not practical to logon to a machine under a service account in order to link the databases to SVN.


Any feedback on this matter is greatly appreciated.

Thanks,
Daniel
instalectual
 
Posts: 13
Joined: Wed Sep 04, 2013 7:42 pm
Location: United States

Postby andy.campbell.smith » Thu Sep 26, 2013 5:24 pm

Hi Daniel! This is quite a tricky question.

When you link a database to SQL Source Control, SQL Source Control creates a couple of folders in %localappdata%\\Red Gate\\SQL Source Control 3\\ and records them in LinkedDatabases.xml, also in that directory. Here's my best guess as to how we could recreate that without using SQL Source Control directly:

First, link the database with your account and use the steps in this article to relocate the Working Base to a shared area:

http://documentation.red-gate.com/displ ... rking+base

Then copy LinkedDatabases.xml and RedGate_SQLSourceControl_Engine_EngineOptions.xml from your local app data to the All Users or service account profile folder.

As far as I can tell that ought to get it working, but this isn't officially supported and hasn't been tested, so I can't promise anything. Hope that helps!
Andy Campbell Smith

Red Gate Technical Support Engineer
andy.campbell.smith
 
Posts: 173
Joined: Thu Oct 20, 2011 11:19 am
Location: Red Gate Software


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest