rcook349

We have 3 developers incuding myself and want to use VSTDB to version control and manage our database (for an app we are currently designing).

Since each developer has a local development instance of the database on our respective machines, what is the best way to manage changes I.e. I'm used to being a one man show and I can just make changes at-will on my local database. Then, when its time to promote those changes to Test, I can do a compare schema and update Test to look like my local.

But with 3 developers it can't be done that way. When one of needs a change should we:

1) make it on our local and then update the database project

2) designate one of us as the only person to make changes to the project file and make requests through him/her

3) each developer's local database is exactly the same and they get updates only when we make changes to the project file and send to each

4) other

Its just too easy and convenient for a developer to make a change to their local database and keep developing, but I need to know the proper way of managing all of our changes.

Thanks for any best practices.

Ron




Re: Visual Studio Team System - Database Professionals How best manage database changes when working with multiple developers?

Christian Whitehead - MSFT

I would recommend keeping the schema under source control - (Visual Source Safe, Team Foundation Server). By doing this, you can allow the project to represent the "Truth" if you will.

When you need to make a change:

1. Sync your project with the source control server, making sure that you have the latest bits.

2. Make the changes.

3. Run unit test (Recommended).

4. Commit to source control.

5. Build/Deploy.

If this makes you un-easy, after you run your update from source control do a schema compare to make sure that you have an acurate project. This is much more akin to what happens in application development, and one of the aims of VSTDB was to bring that same process to database development.






Re: Visual Studio Team System - Database Professionals How best manage database changes when working with multiple developers?

JohnTMSDN

Does this arrangement allow you to pick which changes to move to a production database Let me throw out a hypothetical situation:

Let's say that each of Ron's three developers is working his own feature. Each of these feature uses some of it's own stored procedures and all of these stored procedures are checked into source control. When it's time to deploy, one of the features isn't ready, however, Ron would like to go ahead and deploy the features that are. Assuming that Ron knows which stored procs go with each feature, can Ron choose to deploy the stored procs for just the features he wants to deploy

Thanks.






Re: Visual Studio Team System - Database Professionals How best manage database changes when working with multiple developers?

Christian Whitehead - MSFT

Yes, It would allow that. There are a few ways to go about that too.

1) You could schema compare the changes into your database. Preforming a schema compare between your project and the production database, then unselecting the unfinished stored procedure. Thus when you choose to write updates, only the changed procedures would get deployed. Now the problem with this method is that it isnt condusive to a larger database enviroment.

2) You can choose not to include the unfinished sproc in the build. To do so, select the object, in this case the sproc and go to the properties pane. In it you will see a build option, select not in build. Now, when the build script is generated, the object will not be part of it. The only thing that you need to remember with this option, is to re-enable the oject for build. This property is part of the project file as well, so it would be presisted by source control.

Hope this helps.






Re: Visual Studio Team System - Database Professionals How best manage database changes when working with multiple developers?

StevenPo - MSFT

I'd add to Christian's comments that you could also, if you wanted to deploy an older version of one schema object with current versions of others, you can do so by associating specific versions of your files with a version control Label. Then, on your build machine, you sync to that label, build the labelled version of the database, and deploy that into production. In the future, if you needed to service that deployed version, you can branch from the labelled version if necessary.






Re: Visual Studio Team System - Database Professionals How best manage database changes when working with multiple developers?

JohnTMSDN

Christian and Steven,

Thanks for replying. DB Pro really does sound like a quality product - the kind that you wouldn't realize how much you needed until you used it for awhile, if that makes sense.

Thanks again.

John