How to link database to an existing project in TFS?

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, andy.campbell.smith

How to link database to an existing project in TFS?

Postby SamuelV » Fri Jan 25, 2013 8:25 pm

Can we link database to an existing project in TFS?

It seems we've to link to an empty folder, but if we do that won't we lose history of existing source code in TFS?

How should we preserve that version history? This might be obvious, but I'm confused. Appreciate your help!

~Sam.
SamuelV
 
Posts: 2
Joined: Fri Jan 25, 2013 8:07 pm

Postby SamuelV » Sun Jan 27, 2013 4:34 am

Ah, got it. I've to create a new empty database and link it to source control and do a get latest.
SamuelV
 
Posts: 2
Joined: Fri Jan 25, 2013 8:07 pm

Postby David Atkinson » Sun Jan 27, 2013 9:14 pm

As well as linking a blank one, you can also link an existing database to a folder representing a source controlled database.

David Atkinson
Red Gate
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

I still don't get it

Postby VG_mnet » Mon Jan 28, 2013 4:15 pm

David, I read your reply but I still don't get it. How do I link an existing db with an existing database project in TFS? If I choose my existing project it tells me it must be an empty folder. Then I literally get linked to an empty folder and not my existing project. I am very confused.
TIA
-VG
VG_mnet
 
Posts: 4
Joined: Mon Jan 28, 2013 4:09 pm

Postby David Atkinson » Mon Jan 28, 2013 4:36 pm

Are you trying to link to a dbproj "Data Dude" (or DBPro) database project? If so, you're right that this wouldn't work. We only support the newer SSDT database project type (sqlproj), and even this needs this "beta" build, as we are still in the feedback-gathering stage. It can be downloaded here:

http://www.red-gate.com/SQLSourceContro ... olsSupport

Kind regards,

David Atkinson
Product Manager
Red Gate
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby VG_mnet » Mon Jan 28, 2013 4:42 pm

Hi David, we are trying to link to a Visual Studio 2008 Database Project (dbproj). We want to upgrade to SQL12 but the new versions of the SQL projects (sqlProj for SSDT) do not give us the same level of functionality as the VS 2008 used to, so I was hoping to convert our VS 2008 db projects into Redgate to see if that works for us better than SSDT. Do we have to start our source-control over from scratch then? And if so, when I link to a blank TFS project, how come "Get Latest" doesn't download all the objects to our file system? I want to be able to execute a stored proc against multiple databases (test, then staging, then prod if the first two go well), and I'm not sure how your interface allows for that.

Thanks
-VG
VG_mnet
 
Posts: 4
Joined: Mon Jan 28, 2013 4:09 pm

Postby VG_mnet » Wed Jan 30, 2013 3:35 pm

Can someone help me on this question? When I link to a blank TFS project, how come "Get Latest" doesn't download all the objects to our file system?
VG_mnet
 
Posts: 4
Joined: Mon Jan 28, 2013 4:09 pm

Postby David Atkinson » Wed Jan 30, 2013 6:33 pm

SQL Source Control can only link a database to an entirely blank folder, which is what you would need to do if you want to start source controlling your database, or it can link to a pre-existing source controlled folder. This pre-existing folder can be a Red Gate-created one (has a redgate.ssc file in it) or an SSDT project (has a sqlproj file).

If you have a dbproj folder then SQL Source Control will not recognize it.

I'm guessing that you must have created an SSDT (sqlproj) database project if you managed to link it. If this is blank and the database has objects then the next step would be to "Commit" the objects. "Get Latest" will be blank as there's nothing to "get".

David
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby VG_mnet » Fri Feb 01, 2013 3:08 pm

Thank you David. I did do a blank project just to try to get something working. I think I get it now - I am used to "Commit" meaning that the source-controlled changes are committed to the database, and "Get Latest" meaning that the objects are downloaded from source control to the file system. It appears that this means the oppposite in Redgate so that will take some getting used to, but I have been able to populate the source-controlled objects now after "committing".
-VG
VG_mnet
 
Posts: 4
Joined: Mon Jan 28, 2013 4:09 pm

Postby David Atkinson » Fri Feb 01, 2013 3:11 pm

That's great news. Do let us know how you get on. Any feedback we get on the database project functionality in the coming weeks will help us determine what needs doing to release this feature with the full product.
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 1 guest