Home Forums Programming General Add SQL Objects to TFS/ Version Control RE: Add SQL Objects to TFS/ Version Control

  • 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.