Yves Forget
Yves Forget

Reputation: 139

SSDT SQL Server Data Tools Customer specific requirements

We are using SQL Server Data Tools (SSDT) to manage our customer databases.

In theory all databases are identical, but in practice we have a few stored procedures (and one trigger) that would change from one customer to another.

We created a main SSDT for everything common, and then one SSDT per customer containing only the specific stored procedures (no tables).

In the specific SSDTs we get warnings because SSDT can't find the tables referred in the stored procedures, but we can live with that (obviously SSDT won't be able to validate the table's fields since it can't find the table). For the trigger, we get an error (table can't be found), thus the database project doesn't compile.

How should we manage that? I guess we should not be alone in this situation.

Is there a way for a database project to refer objects (tables) from another database project ?

Thanks,

Yves Forget

Upvotes: 0

Views: 83

Answers (2)

Dmitrij Kultasev
Dmitrij Kultasev

Reputation: 5745

Daniel N gave the right direction, I'll just explain. Let's say you have database project named DatabaseA which will contain the only objects that 100% match for every customer. Then you create another database project DatabaseB and include DatabaseA as "the same instance, the same database". In database DatabaseB you can add customer specific objects. Then you can create other database for other customer in a similar way.

Upvotes: 1

Daniel N
Daniel N

Reputation: 1208

IN SSDT you can add another database project or dacpac as a reference. In the properties for the referenced project you will be able to set where the referenced database resides, same server same database, same server diff database etc

https://msdn.microsoft.com/en-us/library/jj684584%28v=vs.103%29.aspx?f=255&MSPPError=-2147217396

Upvotes: 1

Related Questions