“This database is already linked using the Dedicated model” message is shown when linking a database to source control

Applies to

ApexSQL Source Control

Symptoms

This database is already linked using the Dedicated model” info message is shown when trying to link a database to source control.

Problem

This message will be shown when the Link a database to source control command is used from the right-click context menu in the Object Explorer pane for a database that has already been linked to source control in a Dedicated development model:

Linked in Dedicated model

This behavior is caused by the remaining framework objects in the chosen database and the background source control files are deleted for some reason.

Solution

To resolve this issue and link the database to source control again, the framework objects need to be deleted.

First, expand Databases and then navigate to Programmability | Database Triggers folder, select the ApexSQL_SourceControl_DDLTrigger object and delete it:

ApexSQL Source Control DDL Trigger

Then navigate to Tables, expand it, under System Tables select the dbo.ApexSQL_SourceControl_DatabaseLog table and delete it:

dbo.ApexSQL Source Control Database log

After deleting these two objects, the chosen database can be linked to source control again.

Affected versions:

This issue affects all of ApexSQL Source Control versions.