"Model already has an element" errors (TSD04105) when using Visual Studio 2008 Database Project GDR2
Asked Answered
E

2

4

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?

Escalator answered 20/7, 2010 at 21:8 Comment(0)
M
3

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.

Marianelamariani answered 13/6, 2011 at 6:51 Comment(0)
R
0

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

syn_BeerName    
vw_BeerName
tblBeerName

Usually, synonym to view, view to table.

Rude answered 23/3, 2021 at 19:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.