Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Add SQL Objects to TFS/ Version Control Expand / Collapse
Author
Message
Posted Friday, July 16, 2010 12:52 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, December 30, 2013 2:21 PM
Points: 552, Visits: 197
I work for a small company and we are trying to get all database objects in to TFS. Our dot net code is already in TFS but SQL objects code still not in source safe.

We use TFS 2005 and Visual Studio 2005 and SQL 2008.

Currently we only add SQL objects to TFS if we make changes to it recently. What we are trying to do is add all objects in to TFS one time and then manage it from within TFS - this will give us a history of all changes and also help us version the scripts.

One issue though - we need to maintain different versions of the code since some of our customers are in different versions. Like our latest build is 7.3.0 but some customers are in 7.0.0. and some are in 6.x.x etc.

So every time we start a new build effort, we branch the code and start developing in the version.

How will the SQL objects be managed if we are to create a branch and yet maintain history of changes?

Are we trying to accomplish too much? Would you have any ideas on to do this (add SQL objects to TFS and Source Control at the very least)?



Post #954113
Posted Friday, August 20, 2010 3:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 10, 2011 6:00 AM
Points: 5, Visits: 35
Have you looked into using Red Gate's SQL Source Control, http://www.red-gate.com/products/sql_source_control/index.htm. It allows you to source control your db schema objects in TFS direclty from SQL Server Management Studio.
Post #972852
Posted Monday, January 28, 2013 5:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 20, 2014 5:59 AM
Points: 5, Visits: 46
This is not a solution.
I hope it should be inbuilt functionality into TFS 2010.
Thanks
Regards
Shyam
Post #1412351
Posted Tuesday, January 29, 2013 7:26 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 12:44 PM
Points: 519, Visits: 2,835
Any chance you can upgrade to Visual Studio 2010 or later? SQL Server Data Tools, which is available in 2010/2012 is pretty darn useful, and it makes database development much easier. May not be an option in your case, but it might be worth looking into.

What I've done with past versions of Visual Studio is to script out objects from the database (which can easily be done with SQL Server Management Studio) and then I stuff them into a database project in VS. And from that point on, any database work I'd do in SQL Server Management Studio and just use the Visual Studio database project as a "dumb" repository to keep TFS in synch with my work. With SQL Server Data Tools though, I've moved my development over to Visual Studio almost entirely. Integration with TFS works well, and I'm able to develop and deploy changes without having to go back and forth between VS and SQL Server Management Studio.

As far as branching your code, it seems like you're doing it right if you need to start a revision for a particular customer. I think what you are missing is what you do with the branch once you are done with it and how to deliver the updates to the customer. Your branch needs to be merged back into the code that you branched from (back to the "trunk", the "trunk" being the baseline of code that you branched from). But then, if you have multiple customers on different versions, you may actually have a set of baseline "trunk" code lines that you have to manage, one per customer. But the basic idea is that you branch code from a trunk baseline, make your changes to the branch and once it's tested and ready, merge that branch back to the trunk and then deliver the code to the customer as a "release" (and the the "release" can just be a branch from the newly updated trunk).

Anyway, this is just one way to manage your version control system, it's what we use where we work but it may not be appropriate for you. Hopefully gives you some ideas though.



Post #1413040
Posted Tuesday, January 29, 2013 10:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 20, 2014 5:59 AM
Points: 5, Visits: 46
Thanks,
However I am trying to add Sql server database into TFS using VS 2012.
I hope this should work.

Can you please list out some steps to add Sql Database project into TFS using VS 2012
Thanks again.
Regards
Shyam Raghuvanshi
Post #1413175
Posted Tuesday, January 29, 2013 10:29 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 12:44 PM
Points: 519, Visits: 2,835
Well, we don't use VS 2012 yet and I've not tried this with VS 2012, but I'll give it a shot.

1) Get Sql Server Data Tools! Download and install the appropriate version for you, there's one for VS 2012.

http://msdn.microsoft.com/en-us/data/hh297027

2) Create a new database project (make sure it's the SQL Server Data Tools project though, and not the default Visual Studio database project)

3) Reverse-engineer your database into your project. I use the "Schema compare" feature to do that, but I don't think that's the only way.

4) Add your project to TFS

That's basically it. Once you have the project in Visual Studio and have added it to TFS, you're pretty-much good to go.

You'll need to do your own research on how to use SQL Server Data tools, there's a lot to it and I can't possibly explain it all, especially since I don't use all of its functionality. There's plenty out on the internet to show you how to do that, though. Here's a link to a Tech-ed presentation on it:

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV207

But google for SSDT or "SQL Server Data Tools" and you'll find lots of info.



Post #1413185
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse