microsoft / microsoft/DacFx

Unresolved reference to object in SQL project results in build warning instead of error

Open
#412 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

- SqlPackage or DacFx Version: 162.1.x
- .NET Framework (Windows-only) or .NET Core: both

If I have a stored proc in the project that is just a select statement from a table - the stored proc can have unresolved references and the build still succeeds. (with a warning)

image

**Did this occur in prior versions? If not - which version(s) did it work in?**
As recently as 2017 (tbd about 2019), an unresolved object reference resulted in an error:
https://the.agilesql.club/2017/11/ssdt-how-to-fix-error-sql17502/
![image](https://github.com/microsoft/DacFx/assets/12227241/a2da607d-d288-41f0-8b31-61543a382a54)

**A repro environment would be any SQL project with a single stored proc:**
```sql
CREATE PROCEDURE dbo.SomeProc
AS
BEGIN
SELECT * FROM dbo.TableDoesntExist
END
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in a SQL project using the supplied dbo.SomeProc example and verify the behavior with SqlPackage or DacFx 162.1.x on both .NET Framework and .NET Core. Trace the SQL project build diagnostics, then confirm that the unresolved dbo.TableDoesntExist reference is reported as an error rather than a warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
build-system, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.