Is it possible to update the SSDT DB project from the database?

We have two software projects that communicate with the same database. Currently SQL databases are all made in a database and they rely on developers to ensure that both sets of projects are independently updated to use the latest database model. Compounding these issues, both projects are in separate solutions in separate source control repositories.

While I admit that this is a dire situation, I have inherited this situation, and although my long-term goal is to consolidate and share (many) duplicated logic between them in one common project shared between two sets of applications for various reasons, it is impossible to go straight to this due to critical deadlines and the need to merge them iteratively and schedule it with other developers so as not to disrupt the work too much.

With that in mind, I really want to use SSDT to at least get started creating a source-controlled database structure and make it easier to manage, as there are a few changes to the database I'm going to make.

The problem with SSDT in this scenario is that you can only import once from the database. Thereafter, the option is greyed out and unavailable, which seems to be the design of SSDT as it is explicitly stated in the MSDN documentation.

Is there any easy way to update my SSDT project without using the current project and recreating it every time someone makes a change to the database structure?

+3


source to share


3 answers


First, your right, this is a terrible situation, so work to improve it in the long run!

There are two things you can do: first, you can use SSMS "Generate Scripts" to export all objects, and then use SSDT import to import from scripts - this is not greyed out.



The second thing you can do is manually make changes to use schema comparison in SSDT, you can set the database as source and project as target and choose what you drop, update and import.

Ed

+5


source


I'm going to compare solution:
Select schema comparison and make my database as source project and database as target then compare and update



see answer

0


source


delay his bit in response. I am using VS2017 Database project where I achieved this task by comparing local database to database project after comparison, you can update the database with refresh button.

Step 1 right click on the database project and select the schema compare item.

Step 2 select target -> select database connection option

Step 3 change source and target

Browse screenshots for more details enter image description here

0


source







All Articles