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

DacFx/SchemaComparison isn't correctly comparing schema-identifier on procedures/views/UDFs name/identifiers. #511

Open
sdonovanuk opened this issue Oct 15, 2024 · 0 comments
Labels
area: schema compare bug Something isn't working

Comments

@sdonovanuk
Copy link

sdonovanuk commented Oct 15, 2024

  • SqlPackage or DacFx Version: 162.4.92
  • .NET Framework (Windows-only) or .NET Core: .NET Core 8.0
  • Environment (local platform and source/target platforms): MacOS, Linux

Steps to Reproduce:

Apologies, I originally thought this was an SMO bug (logged here), but now I don't think so.

To recreate, create two databases, each with 1x procedure in, like so:

CREATE DATABASE LEFT
CREATE PROCEDURE GetServerName AS BEGIN SELECT @@SERVERNAME END
CREATE DATABASE RIGHT
CREATE PROCEDURE dbo.GetServerName AS BEGIN SELECT @@SERVERNAME END

You'll note, in database RIGHT, we've added the schema-identifier.

If you run DacFx/ScriptComparison against these two databases, it returns with 1x difference. It states that the procedure in LEFT has no schema, but the procedure in RIGHT has a schema.

This is odd.

According to the documentation for CREATE PROCEDURE, if no schema is provided, it will default one. Indeed, for database LEFT, if you check sys.procedures, the schema is dbo/schema_id=1.

Note: I have the same problem with views, UDFs, etc.

Question: Can someone please help me understand why ScriptComparison is returning a difference? To me, this sure looks like a bug.

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

I haven't tried in prior versions.

Thank you!

(DacFx/SqlPackage/SSMS/Azure Data Studio)

@sdonovanuk sdonovanuk added the bug Something isn't working label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: schema compare bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants