Keeping a SQL Server Database Project and the Actual Database (in SSMS) in sync during development
I am trying to figure out what the normal workflow should be between a SQL Server Database Project and the actual database in SQL Server (SSMS) once they are in sync. The main reason I am using one of these projects is to keep everything in Source Control.
Here are the steps I took to set things up:
- Create the actual database and entire schema in SQL Server Management Studio.
- Create a new SQL Server Database Project in VS2015.
- Right click the project and import the actual database.
Now that the project is in sync with the actual database, how should I go about making changes going forward? Do I make them in the database project and then republish it or do I make them in the schema? Basically what I am saying is that I am trying to avoid making schema changes during development in both places.
One Solution collect form web for “Keeping a SQL Server Database Project and the Actual Database (in SSMS) in sync during development”
Generally the best practice will be to make changes to the project, check that into source control, and publish the changes to your database as needed. Your project then becomes your source. You can branch it, merge it, and do whatever else is needed to do your development. You won’t be republishing your database, though. You’ll update your existing one when you publish your project. It will do a diff between your project and the db, then make the appropriate updates/alters to bring your database in line w/ the project.
I blogged about my experiences with SSDT here: http://schottsql.blogspot.com/search/label/SSDT, but there are some other great resources available if you look. There are definitely different ways to do things and what I chose may not fit your environment exactly.