Search code examples
sql-servervisual-studiosql-server-data-toolsdatabase-projectdacpac

Data Project using SSDT, how to reference another database without it populating in same project folder in SS Obj Explorer


I have a Database Project in Visual Studio called AMC.

In AMC I have a view, which references an object in another Database (on same instance) called AMC2 that was raising errors in the project; the error was it didn't recognize the AMC2 reference.

So I got the dacpac from AMC2 and added it as a reference. Now my view script doesn't throw errors in the projects as it has a known reference, but in my SQL Server Object Explorer (in Visual Studio), I'm seeing stored procedures and tables etc from the other AMC2 being combined with AMC.

How can I reference AMC2 in my AMC database project without that mixing of db objects happening in the SQL Server Object Explorer under my AMC Project?


Solution

  • There's an option in VS SQL Object Explorer to not show external objects. Click the Filter button at the top and turn off "Show External Objects" to stop seeing the objects not actually in your DB. enter image description here