3
votes

Visual Studio 2013 - Attempting to build a Database Project.

Build Error with a SQL view due to it not recognising a Synonym.

When I right click the database project and build my Database I get the following error:

D:\Users\Dave\Documents\Visual Studio 2013\Projects\DataSync\UAT_DB1\UAT_DB1\dbo\Views\uvw_FirstFix.sql(12,7): Error: SQL71501: View: [dbo].[uvw_FirstFix] has an unresolved reference to object [dbo].[Synonym_X].

Now the view [dbo].[uvw_FirstFix] has a reference to the Synonym, [Synonym_X] which references a table in a different database. I have added it the second database into the Visual Studio project and added a database reference to it.

The problem seems to be Visual Studio not being able to recognise the synonym as a synonym.

Has anyone come across this problem and how to resolve it please ?

1
Is the synonym defined in the database project? Besides, why Visual Studio 2013? SSDT is a separate download now which can be installed separately. A lot of bugs have been fixed since 2013 - Panagiotis Kanavos

1 Answers

1
votes

Please review and correct your VIEW in Database View: [dbo].[uvw_FirstFix].

There's a reference to it and compiler is unable to find it.