Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

String value "looking" the same, but there is a difference (cannot use distinct)

$
0
0
Hi all,I am having an issue with using distinct on one single column in a table and getting multiple result rows for a string "looking" the same. When I hashbyte the values, I can see that there must be a difference.But I have no clue how to get rid of this behaviour... please help:MS SQL Server 2014 (Server, DB and Field Collation are all the same - Latin1_General_CI_AS)City column is defined as nvarchar(50)Table with column "City", doing a "select distinct city from table1" I get below city multiple times:Column CityZweibrückenZweibrückenZweibrückenWhen doing a Hashbyte, I can see that there seems to be a difference of these values:Column City Column City_HashbyteZweibrücken 0x31244719AA18450C404BD27E1F0B07A36E7840A2Zweibrücken 0xBD0FF24BCB34A0A2C83AE9069E59F33A588110E9Zweibrücken 0xD7BEF38644E48185EBC60B207EFF33F7DE50D8BFAll data is imported from one single XML file onto one single table. So I really don't get where this difference is coming from and how this can be overcome.Thanks for any input / suggestion.

Viewing all articles
Browse latest Browse all 3145

Trending Articles