Continuing my series on SSDT based deployments, in this part, I’m going to look into something that’s not entirely SSDTs fault, but I’m sure could be less painful: importing pre-existing databases into an SSDT project. Particularly ones that have cross database references, or three part naming of objects (database.schema.object) which effectively make them a self referencing object.
Firstly, I want to state that I don’t really like cross database references. In a world of filegroups, schemas and so on, I think a large number of multiple database setups should probably just be merged into a single db. I address quite a few of these thoughts in my article SQL Server – When is a new database appropriate?
However, I’m also aware that this refactoring takes time, and that the damage is already there. Add this into the fact that these databases will most likely not have been developed with any source control, and so somehow we have to drag them, kicking and screaming, into TFS and an SSDT project…..