Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSDT gets inconsistent compile result on non-existent column #516

Open
Yue0119 opened this issue Oct 30, 2024 · 2 comments
Open

SSDT gets inconsistent compile result on non-existent column #516

Yue0119 opened this issue Oct 30, 2024 · 2 comments
Assignees
Labels
area: model resolver Related to issues resolving dependencies when building schema model bug Something isn't working

Comments

@Yue0119
Copy link

Yue0119 commented Oct 30, 2024

  • SqlPackage or DacFx Version: 1.0.0.0, the default one
  • .NET Framework (Windows-only) or .NET Core: .Net Framework 4.7.2
  • Environment (local platform and source/target platforms): SQL Server 2019 or above

Steps to Reproduce:

  1. Open the attached project, build it you will get the SQL71501 error
  2. Change the testsp.sql query to below, build it again, the compile will succeed even the Id3 still not exists
    CREATE PROCEDURE [dbo].[testsp]
    AS

SELECT
DISTINCT col1
INTO #Reset
FROM tb1 AS tmpo

SELECT c.col1,tb1.col1,v1.Id3 FROM
tb1
left join #Reset as c on c.col1=tb1.col1
left join v1 on tb1.col1=v1.Id3

SSDTTest.zip

**Did this occur in prior versions? If not - which version(s) did it work in? Not sure, it can be reproduced on both SSDT 2017 and 2022

(DacFx/SqlPackage/SSMS/Azure Data Studio)

@Yue0119 Yue0119 added the bug Something isn't working label Oct 30, 2024
@llali
Copy link
Member

llali commented Oct 30, 2024

I was able to repro this issue and the weird thing is, if we reverse the join statements, the build error will show up
CREATE PROCEDURE [dbo].[testsp]
AS
SELECT
DISTINCT col1
INTO #Reset
FROM tb1 AS tmpo

SELECT c.col1,tb1.col1,v1.Id3 FROM
tb1
left join v1 on tb1.col1=v1.Id3
left join #Reset as c on c.col1=tb1.col1

@llali llali self-assigned this Oct 30, 2024
@llali llali added the area: model resolver Related to issues resolving dependencies when building schema model label Oct 30, 2024
@llali
Copy link
Member

llali commented Nov 4, 2024

SSMS also shows the same result as SSDT and doesn't show any error for the query Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model resolver Related to issues resolving dependencies when building schema model bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants