0

Me and my team are developing a SQL Server database. We want to work on different PCs, but with the same database. Is it possible that we can synchronise our work on each PC, or share our database while working somehow?

If possible how can Team Foundation server be used for that?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 3
    Use some form of version control like Git and have one master branch and different sub branches you each work from to which you will finally merge together to master. – Cowboy Farnz Jan 22 '18 at 10:06
  • Would this be useful for you? https://stackoverflow.com/questions/27582844/automatically-sync-sql-databases-across-two-computers – S Raghav Jan 22 '18 at 10:07

2 Answers2

0

If you only care about schema changes (and not data changes), you can use visual studio's SQL Server projects, and a source control system, to help manage this. You can then use the Schema Compare tool to compare your project to the server, the server to your project, or server to server.

There are some tools from the likes of Redgate, etc, that allow this process to be automated. I've not used those, but they may be another option.

Gamic
  • 326
  • 2
  • 4
  • Thanks for the mention. Those tools from Redgate are SQL Source Control and ReadyRoll, in case anyone wants to find out more! There's more information about how they differ on our website. – David Atkinson Jan 22 '18 at 20:18
0

You can use SQL Server Database Tools (SSDT) to represent your database as a series of scripts. These scripts can then be added to source control. Git is by far the most popular source control system there is and Team Foundation Server and Visual Studio Team Services have great Git support.

Each developer will use Visual Studio (or VS Code) on their own machine to do their database work. When the developer wants to share their changes, they commit them to source control. Other developers can then update their local version of the code with the new changes. SSDT adds support for bringing your database and database project in sync.

Now that your code is in source control you can go a step further and add things like continuous integration builds and automated deployments with VSTS Build and Release Management. That way you can automatically test database changes and even run unit and integration tests before deploying to test and production environments.

The following Channel9 video gives an introduction to these tools: Database Continuous Integration and Deployment with Visual Studio SQL Server Data Tools in < 10 minutes

Wouter de Kort
  • 39,090
  • 12
  • 84
  • 103