Question

Can I have multiple database projects to the same SQL Server database? Like, one main project referencing multiple subprojects.

I have an application with multiple modules and each module has its own database structure living in a schema.

I want to reuse the modules in another application, for example, the security module, which has the user, roles, groups, etc.

I want to know if there is a way I can define those schemas and all of its objects (tables, stored procedures, indexes, views, etc) in one database project and then reference this "base" database project in the database project of the actual application.

Was it helpful?

Solution

Certainly appears you can do that in Visual Studio 2012. I just created a Database Project "database1", then added another database project to the same Solution, named "database2".

I then right-clicked the "Database1" project, clicked "Add Database Reference" and selected the "Database2" project. Then, under "Database Location" I chose "Same Database".

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top