we want to start using the SQL Server Database Projects for our databases. The thing is that we have two seperate databases with almost the same table structures, stored procedures, etc. but have a few minor differences. For example one of the two doesn't make use of a few of the tables and does have different users and permissions granted. What would be a good way to keep the two databases on the same level? Is it possible to keep just one database project for the two seperate databases and "deactivate" parts on one machine?
If I didn't make clear what I mean: Image a small Data Warehouse for two stores, with one having table "cars", "motorbikes" and "bikes" but not selling bikes so it makes use of just "cars" and "motorbikes". Is there a way to keep all three tables in the database project but "deactivating" the one table for the second Data Warehouse and Likewise for users, permission, and so on?
Thanks in advance! I literally appretiate all the advice given.
You could do a "base project" and then add the differences on top of that base project with a database reference to the base project as "same database, same server" to include all of the shared items. That's probably your easiest way to handle that sort of development. Unless the differences are significant and you shouldn't see those extra tables at all, I don't know that I would go to that effort in most cases, though. Have one schema for everything and just don't use the objects that don't make sense for that particular database.
But if that's not feasible for whatever reason, your best bet is one Solution, one base project, then other DB projects that reference that base project but have their own different objects. This is usually called a "Composite" project.
The following links may help some to explain that a bit more:
https://learn.microsoft.com/en-us/sql/ssdt/add-database-reference-dialog-box
https://www.sqlservercentral.com/articles/two-approaches-to-addressing-circular-references-in-ssdt