Warning SQL71502 - Procedure <name> has an unresolved reference to object <name>
Asked Answered
P

3

12

I'm getting the following warning in my Visual Studio 2013 project:

SQL71502 - Procedure has an unresolved reference to object

Warning SQL71502

Peanut answered 28/4, 2015 at 3:20 Comment(1)
possible duplicate of unresolved reference to object [INFORMATION_SCHEMA].[TABLES]Snowcap
P
24

This can be resolved by adding a database reference to the master database.

  1. Add Database Reference:

Add DB reference

  1. Select the master database and click OK:

Select database

  1. Result:

Result

Peanut answered 28/4, 2015 at 3:20 Comment(6)
This did not work for me on SQL Server 2012 and VS2013Goat
This doesn't fix SQL71501 or SQL71502 where the query uses FROM [tablename] alias CROSS APPLY alias.[xmlcolumn].query('/*') AS xResult(columname) to consume columns of type xml, even though the query parses and works.Desmond
This did not work for me on remove SQL server 2012 and VS2015 too, I have to change the build to compile on error page propertySteamy
This did not work for me either. (Sql Server 2016 and VS 2017)Magdala
Looks like this doesn't always work for everyone, feel free to update the answer (or post your own) if you find a different way to resolve this.Peanut
If the errors for some missing types don't go away when you add a reference to master, check your target platform in the db project itself. I had warnings about `[dbo].[string_split]' that didn't go away when adding master. The issue turned out to be that although we were using newer versions of sql server (and thus the sproc worked), the dbproject was set to Sql2014 which didn't have that function available.Predetermine
N
2

You just have to set 71502 in the field Buid/Suppress Transact-SQL warning :

See picture in the link

Nakano answered 22/7, 2020 at 13:38 Comment(0)
C
0

Nicholas' answer put me on the right track, but did not fix the issue for me because I had an existing database reference to "master" which was left over from a legacy development environment and SQL server installation.

Deleting this (broken) reference and then re-adding it following Nicholas' instructions worked for me. Note that the "Suppress errors caused by unresolved references..." box wasn't checked by default in VS2019; I had to check that manually.

Checkroom answered 7/7, 2021 at 21:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.