microsoft / microsoft/DacFx

Custom Table Type References not validated

Open
#651 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

  • SqlPackage or DacFx Version: 170.0.94
  • .NET Framework (Windows-only) or .NET Core: .NET Core
  • Environment (local platform and source/target platforms): N/A

Steps to Reproduce:
Create a sqlproj with the following script:

CREATE TYPE TableType as TABLE (
    MyColumn int
)
GO
CREATE PROC TestProc(@L  TableType READONLY) AS 
SELECT FakeColumn from @L
  1. Expected: Build error Procedure: [dbo].[TestProc] has an unresolved reference to object [dbo].[TableType].[FakeColumn]
  2. Actual: Project builds with 0 warnings and 0 errors.

This error is only discovered at deployment, which is a bad time to catch these issues. These types of errors are caught for tables/views but not for table types it seems.

Did this occur in prior versions? If not - which version(s) did it work in?

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided sqlproj script using SqlPackage or DacFx 170.0.94, focusing on the custom table type and TestProc reference. Trace how build validation handles references from tables and views, then ensure the analogous TableType reference reports the unresolved FakeColumn error during build.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.