“Model already has an element” errors (TSD04105) when using Visual Studio 2008 Database Project GDR2

别来无恙 提交于 2020-01-03 17:42:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/3294375/model-already-has-an-element-errors-tsd04105-when-using-visual-studio-2008-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!