Skip to content

Changing Case in XML queries does not flag as a difference #231

Description

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

Steps to Reproduce:
When changing the case of an xml query that is encased in quotes in a database project, SSDT does not flag this as a difference, unless there is another 'valid' difference in the file as well. This means changes wont get deployed and applications will fail.

I have included a Test Solution file and test document so that this can be replicated in this repo
https://github.com/DotdigitalDBA/sqlPackageTickets/tree/main/SSDTXMLBug
Basic steps to reproduce:

  1. Create sproc with xml query
    eg
SELECT
 members.value('.','varchar(100)') as [TeamMembers]
FROM @SQLXML.nodes('/teams/dbateam/team') as team(members)
  1. Run schema compare in VS > No changes
  2. Change case of xml query
    eg
SELECT
 members.value('.','varchar(100)') as [TeamMembers]
FROM @SQLXML.nodes('/Teams/DBAteam/Team') as team(members)
  1. Run schema compare again > Still no changes. Even though this change will now break all your XML queries.

This has been routed through MS premier support. They provided a "workaround" to change collation to a case sensitive collation. This isn't suitable, collation shouldn't play any part here, regardless of the collation you choose, changing case in an XML query will break existing queries.

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

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Activity

ssreerama commented on Feb 27, 2023

@ssreerama
Contributor

Daniel Connolly (@dconnolly131) , Thank you for creating this issue. We verified the issue and able to reproduce the problem you are facing. DacFx sets the default collation as case insensitive collation "SQL_Latin1_General_CP1_CI_AS". Currently, Dacfx does not have any option available to change the collation yet.

Workaround to pass the issue is by changing the collation to case sensitive as suggested by MS premier support. Thanks.

dconnolly131 commented on Feb 28, 2023

@dconnolly131
Author

Hi, thats not a workaround unfortunately, as i advised premier support. We do not want to use a case sensitive collation for our databases. This will break other facets of our environment.

ssreerama commented on Mar 8, 2023

@ssreerama
Contributor

Hey Daniel Connolly (@dconnolly131) , We will be reviewing the issue and work on as priority. will keep you posted on the Issue status. Thanks.

Other workaround that you can try is by having a PostDeploymentScript.sql with the updated stored procedure that you want to deploy. Please let us know if this works for you. Thanks

dzsquared commented on Mar 8, 2023

@dzsquared
Contributor

Confirming that this issue in DacFx where the XML path isn't properly handled (compared with case sensitivity regardless of database collation) has been added to our bug backlog and we'll address it in upcoming releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions