Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
DanW
Starting Member
2 Posts |
Posted - 2006-07-19 : 23:57:43
|
| I recently ran into a strange sorting issue. If you create a table and populate it with data with the following script the results of a query against it are just not right.CREATE TABLE MySortTable(DictionarySort nvarchar(10) COLLATE Latin1_General_CI_AS NULL)GOINSERT MySortTable VALUES ('Alpha')INSERT MySortTable VALUES ('Bravo')INSERT MySortTable VALUES ('Charlie')INSERT MySortTable VALUES ('alpha')INSERT MySortTable VALUES ('bravo')INSERT MySortTable VALUES ('charlie')GOThe query and results looks like this:SELECT DictionarySort FROM MySortTableORDER BY DictionarySortAlphaalphabravoBravoCharliecharlieNotice that the lower case b comes before the upper case B. What's up with that!!!?Life's tough. It's tougher when you're stupid |
|
|
DanW
Starting Member
2 Posts |
Posted - 2006-07-20 : 00:22:36
|
| Figured it out with the help of Tom Cooper.Case insensitive collation doesn't guarantee the order because it is case insensitive. It is still stange that the order is consistent except for the B, but oh, well!Life's tough. It's tougher when you're stupid |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-07-20 : 03:35:56
|
| SELECT DictionarySort FROM MySortTableORDER BY DictionarySort COLLATE Latin1_General_CS_ASPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|