15

We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hoping there is a way to point to a database in SSMS and create a project that can be added to TFS or something similar. Basically, I'm look for the simplest way to get from point A to point B. I've installed the TFS MSSCCI Provider and I see TFS in the source control provider options in SSMS. The SQL Server instance is SS2005.

6 Answers 6

14

If you have a visual studio Team Developer license you can download the Database edition. It has a project type that can bring your tables, sprocs, triggers, etc under source control and check it into TFS.

update:
Redgate has a product called SQL Source Control. Which ties back into several source control systems like TFS, SVN, etc.

3
  • If you have team suite, you already have this installed. Check out this link on the Development / Database edition merge msdn.microsoft.com/en-us/vsts2008/products/cc990295.aspx
    – NotMe
    Oct 9, 2008 at 16:03
  • Database projects have limitations that you will come accross if the schema gets slightly complicated.
    – Ant Swift
    Jul 19, 2011 at 14:31
  • @Anthony: I agree. We use them strictly for version control on the database. Every so often we'll resync the database project with the actual development server and check it back into TFS. On a side note, red-gate has since come out with a product called SQL Source Control which appears to be a pretty good option.
    – NotMe
    Jul 19, 2011 at 14:40
3

You could also try ApexSQL Version, a SSMS add-in for versioning databases and db objects directly in SSMS.

We're in the process of constant improvement and you can also see our roadmap for future improvements in this article: Redesigning ApexSQL Version – The road map

Disclaimer: I work for ApexSQL

Hope this helps

2

I think generating your own scripts is the best way to do it, as described in this excellent series of articles:

http://odetocode.com/Blogs/scott/archive/2008/01/31/11710.aspx

2

I use Tasks -> Generate Scripts in SSMS to create a SQL script that I store in my project. If you do this make sure that you choose options to include things like triggers and indexes. I typically ignore the extended properties in the script generation to make things a little more compact.

2

The simplest way to do this is with Quest Toad for SQL Server. Disclaimer - I work for Quest, hahaha. Anyway, Toad integrates with TFS so you can check objects in and out of source control. You don't have to hassle with scripting the objects out first. If you want to play with it, grab the latest beta version for free, and there's an active user community on that site where you can ask questions.

Toad for SQL Server

1

You probably need Visual Studio Team System For Database Professionals to do what you want.

I use the standard Database project and just keep three scripts per database: one for the schema, one for the stored procs, and one for data population.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.