SQL71501:has an unresolved reference to Schema [win]
Asked Answered
H

1

9

I am getting a unresolved reference in a SQLProject, the error occurs on the create line. All objects are causing it because they are all being created in a specific schema. For example I have Table that is being created in a specific schema"win" Create Table [win].[DataSource]. The error occurs because of the attempt to create it in the "win" schema If I remove the schema from the create statement the error goes away. The database project is a composite project including all of the artifacts (stored procs, tables, views...) from the win schema. Here is an example of the error I am seeing.

Severity Code Description Project File Line Suppression State Error SQL71501: Procedure: [win].[SelectCandidateExamSearch] has an unresolved reference to Schema [win].

Hartzel answered 15/11, 2018 at 0:20 Comment(2)
Have you tried creating script with Build Action: build CREATE SCHEMA [win] ?Fusil
I have actually and that turned out to solve my problem. I did not have a create schema statement. You should post it as an answer.Hartzel
F
23

Create script with Build Action: build with the following SQL statement:

CREATE SCHEMA [win]

where [win] is the schema name.

For any database project in VS to build sucessfully, ALL its references must exist in the scope of the project and be valid.

Fusil answered 19/11, 2018 at 17:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.