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

Fix support for Azure SQL Database on non-default collations #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mark-raymond
Copy link

This PR fixes support for installing the tSQLt framework on Azure SQL Database when the collation is not the default SQL_Latin1_General_CP1_CI_AS.

The problem is that the sys.* view are always SQL_Latin1_General_CP1_CI_AS on an Azure SQL database, even when the database is a different collation. This results in errors when comparing or concaternating strings where one side came from a sys.* view and the other side came from a table/view in the database. By specifying COLLATE database_default, this keeps the behaviour of on-premise SQL Server, where the sys.* views are the same collation as the database.

This fixes support for installing the tSQLt framework on Azure SQL Database when the collation is not the default SQL_Latin1_General_CP1_CI_AS. The problem is that the sys.* view are always SQL_Latin1_General_CP1_CI_AS on an Azure SQL database, even when the database is a different collation. This results in errors when comparing or concaternating strings where one side came from a sys.* view and the other side came from a table/view in the database. By specifying COLLATE database_default, this keeps the behaviour of on-premise SQL Server, where the sys.* views are the same collation as the database.
@T-J-L
Copy link

T-J-L commented Apr 3, 2020

Having the same issue on Azure SQL with collation 'SQL_Latin1_General_CP1_CS_AS', this change resolves the issue.

Copy link

@rbrok rbrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes worked for me with tSQLt Version: 1.0.5873.27393 setup and a CS collation on Azure SQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants