1

I have a Visual Studio database project which I cannot build because of many SQL71501 errors.

Error SQL71501: Computed Column: xxxxx contains an unresolved reference to an object.
Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects.

The reason for the errors is that I have created a View which references an external table. The external table cannot be added into Visual Studio either as code, or as a reference. These external data sources and external tables are handled by a different process when the database is created. Plus, the external tables and external data source have variable names based on the environment which makes adding them into VS impossible. Technically they could be added as dynamic SQL, but then this breaks the security model, which is a different story :(

If it would simply ignore these errors, build and deploy, everything would be okay. But even though I have told Visual Studio to ignore these, it doesn't appear to have any affect.

Error

Error

How can I suppress these errors and force a build?

BrokenBad
  • 95
  • 6
  • 1
    This is an error, not a warning, so there's no suppressing it. You could exclude the view from the project and create it dynamically as well. If you can't add any kind of reference to the object the view references, then the view can't be part of the project either. If this breaks other parts of the projects, consider a dummy view (`SELECT CAST(NULL AS Type) AS Column1, CAST(NULL AS Type) AS Column2, ...`) that has the correct metadata to make the rest build but is replaced with a post-deployment build step on actual deployment. – Jeroen Mostert Jun 09 '21 at 17:36

0 Answers0