Auto-linking database to source control - make it stop.

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace

Auto-linking database to source control - make it stop.

Postby AdamY » Fri Mar 11, 2011 11:02 pm

I am using SQL Source Control v2.0.10.11 and my source control system is TFS.
I have a database called [MyDB] on server [ServDev]. I linked [MyDB] to source control. After deploying [MyDB] to [ServTest], I noticed it is also linked to source control automatically - I didn't manually do anything, but SQL Sourse Control sees it as linked - I assume because the name is the same.

Can I make it so SQL Source Control does NOT automatically link a database to source control just because the database name matches one that is already linked? That seems to be a risky assumption. It would be nice to have control over that; especially because we use a branch/trunk method and the Dev TFS file location isn't necessarily the same as the Test TFS location. Or perhaps I just have 2 databases called [YourDB] that have nothing to do with each other.
AdamY
 
Posts: 41
Joined: Fri Oct 15, 2010 8:24 pm

Root Cause discovered

Postby AdamY » Tue Mar 15, 2011 5:41 pm

Root Cause - no work around:
The server names are actually the same, but in different networks (virtual). I use hosts file entries to connect to each. So...

Server names are both: [ServerA]
The IP for [ServerA] in the Dev network is 1.1.1.1
The IP for [ServerA] in the Test network is 1.1.2.1
My hosts file links 1.1.1.1 to [ServDev] and 1.1.2.1 to [ServTest].

Then, within SSMS, I just connect to [ServDev] or [ServTest]. SQL Source Control uses @@SERVERNAME so even though they are different servers and SSMS sees them that way, SQL Source Control thinks it is the same server.

Red Gate suggested connecting with different Windows Accounts as a work around. But what it tells me is that in our setup, I don't have much of a choice unless I could trick/change @@SERVERNAME which seems a little too risky.
AdamY
 
Posts: 41
Joined: Fri Oct 15, 2010 8:24 pm


Return to SQL Source Control 2

Who is online

Users browsing this forum: No registered users and 1 guest