3

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 ?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
James Khan
  • 773
  • 2
  • 18
  • 46
  • 1
    Do you already see this? https://stackoverflow.com/questions/18096029/unresolved-reference-to-object-information-schema-tables – dwir182 Oct 11 '18 at 06:12
  • 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 Oct 12 '18 at 10:06

1 Answers1

1

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.

Peter
  • 663
  • 1
  • 7
  • 15