简体   繁体   English

使用SSDT的数据项目,如何引用另一个数据库而不将其填充到SS Obj Explorer中的同一项目文件夹中

[英]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. 我在Visual Studio中有一个名为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; 在AMC中,我有一个视图,该视图引用另一个称为AMC2的数据库(在同一实例中)中的一个对象,该对象在项目中引发错误。 the error was it didn't recognize the AMC2 reference. 错误是无法识别AMC2参考。

So I got the dacpac from AMC2 and added it as a reference. 因此,我从AMC2获得了dacpac,并将其添加为参考。 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. 现在,由于具有已知参考,我的视图脚本不会在项目中引发错误,但是在我的SQL Server对象资源管理器(在Visual Studio中)中,我看到来自另一个AMC2与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? 我如何在AMC数据库项目中引用AMC2,而又不会在AMC项目下的SQL Server对象资源管理器中发生数据库对象混合的情况?

There's an option in VS SQL Object Explorer to not show external objects. VS SQL对象资源管理器中有一个不显示外部对象的选项。 Click the Filter button at the top and turn off "Show External Objects" to stop seeing the objects not actually in your DB. 单击顶部的“筛选器”按钮,然后关闭“显示外部对象”,以停止查看实际上不在数据库中的对象。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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