SQL Compare and SQL Source Control - Database not linked

instalectualinstalectual Posts: 20 Bronze 1
edited September 26, 2013 12:24PM in SQL Compare Previous Versions
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

Comments

  • 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
Sign In or Register to comment.