简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM