“模型已经有一个元素”使用 Visual Studio 2008 数据库项目 GDR2 时出现错误 (TSD04105)

发布于 2024-09-10 16:14:32 字数 405 浏览 2 评论 0原文

我正在使用 Visual Studio 2008 数据库项目 GDR2 来管理多个数据库,但遇到许多与同义词相关的错误。

项目 A 引用了项目 B,因为项目 A 与项目 B 中的表有许多同义词。我收到的完整错误是“TSD04105:模型已具有同名 dbo.[OBJECT] 的元素”。这总是指向同义词。

问题似乎是项目 A 上的同义词与项目 B 上的表具有相同的名称。显然,我可以重命名所有同义词,使它们具有与表不同的名称,但这会给我带来大量工作(到目前为止有超过 140 个同义词)。

删除对 Project-B 的引用将消除该错误,但 Project-A 中的所有存储过程都会生成错误,因为它无法再引用 Project-B 中的表。

除了重命名所有同义词之外,有没有办法解决这个问题?在数据库项目中处理这种情况的适当方法是什么?

I am using Visual Studio 2008 Database Project GDR2 to manage multiple databases and I am getting a number of errors related to synonyms.

Project-A has a reference to Project-B because Project-A has a number of synonyms to tables in Project-B. The full error I'm getting is "TSD04105: The model already has an element that has the same name dbo.[OBJECT]". This always points at the synonym.

The issue seems to be that the synonym on Project-A has the same name as the table on Project-B. Obviously I could rename all my synonyms so that they have different names than the tables, but this introduces a LOT of work on my part (there's over 140 synonyms so far).

Removing the reference to Project-B will get rid of that error, but instead all of my stored procedures in Project-A generate errors because it can't reference the tables in Project-B any more.

Is there a way to fix this problem short of renaming all the synonyms? What is the appropriate way to handle this situation in the Database Project?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

君勿笑 2024-09-17 16:14:32

我在 2008 年服务器项目和数据库项目之间遇到了这个问题,我通过使用文字数据库变量值解决了这个问题。

引用项目属性 ->参考文献选项卡 ->数据库变量值

我想说您也可以使用数据库变量名称/值对。

I had this issue between a 2008 server project and a database project and I solved it by using a literal Database Variable Value.

Referencing project properties -> References Tab -> Database Variable Value

I would say that you could also use a Database Variable Name/Value pair as well.

土豪我们做朋友吧 2024-09-17 16:14:32

在我以前的雇主中,我们在每个项目前面都标明了项目类型。

syn_BeerName    
vw_BeerName
tblBeerName

通常,视图是同义词,视图是表。

At my previous employer we prefaced each item with item type.

syn_BeerName    
vw_BeerName
tblBeerName

Usually, synonym to view, view to table.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文