none
SSDT and SQL71502 for every reference in a stored procedure to columns in a view RRS feed

  • Question

  • I am using VS 2012 Update 1 (11.0.51106.01) with SSDT 11.1.21208.0 (the December 2012 release).

    I have a stored procedure that selects from a single view. The view is in my dbo schema. The view selects from a table in a linked server. The linked server connects to a non-SQL Server database. Therefore, it is not possible for me to generate a dacpac or other reference for the schema of that "foreign" database.

    I do not get any warning about the view reference in the FROM clause of the SELECT in my stored procedure. However, I do get a warning for every column reference in the SELECT and WHERE clauses:

    SQL71502: Procedure: [dbo].[myProc] 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: [dbo].[myView].[myColumn] or [dbo].[myView].[myAliasForMyView]::[myColumn].

    It seems odd that it confused by a supposedly ambiguous reference between the view and the alias for the view when every reference to the view is made using the alias, so there can't possibly be any ambiguity.

    It would be reasonable that I would get a warning about the references to the Linked Server table in the view .sql file, but not the stored procedure that does the SELECT from that view, because the view definition clearly specifies [myColumn] by name.

    For the record, "Extended Transact-SQL Verification" is disabled for this project and all of the files within it are set to Auto for that property.

    There is no option to suppress this warning on a file by file basis, and I'd prefer to not disable it for the entire project. On the other hand, any warnings I might care about are getting get lost in the noise from all these spurious SQL71502 warnings.

    What can be done to resolve this?

    Thanks,
    Mark

    Tuesday, March 19, 2013 9:16 PM

Answers

  • Hi Mark,

    It is possible to suppress this warning on a per-file basis. In the properties pane there is the "Suppress TSQL Warnings" property which takes a list of the code(s) to suppress.

    Cheers

    Leyton

    Wednesday, March 20, 2013 2:39 PM

All replies

  • Hi Mark,

    It is possible to suppress this warning on a per-file basis. In the properties pane there is the "Suppress TSQL Warnings" property which takes a list of the code(s) to suppress.

    Cheers

    Leyton

    Wednesday, March 20, 2013 2:39 PM
  • Leyton,

    Thanks! That does work to hide the symptom of this problem.I still hold out some hope that Microsoft will acknowledge it as a bug.

    - Mark

    Wednesday, March 20, 2013 3:09 PM