Solution: SQL Server
In addition to my previous post:
I would like to add that the collation can also be used in joins or Select statement when you need to change the behavior to be case sensitive.
There are some scenarios, especially when either the legacy or the target system are case sensitives, where we need to create some reports or mapping rules taking this into consideration.
This typically happens with user names or codes, where upper case and lower case means different things.
I have created a simple table for this example:
If we look for duplicates, as the default collation in SQL is CI (case insensitive), the result is:
Then, let's say we want to create a join with this other table:
The result, as they are case insensitive, is the full list of aliases:
In cases where these values are not duplicates, we need to change the collation.
To do this, select a collation that is case sensitive, (e.g., Latin1_General_CS_AS):
Here you can see that the result is only BOA and test.
Also, you can use it in a Select statement to look for duplicates (for instance):
Showing now that there are not duplicates.
I hope you have found this post interesting.
Please do not hesitate to ask any questions.
Comments
0 comments