I am working on the insertion of addresses and other info for a database where addresses can be from multiple countries or in other languages. Below is a summary of what I am doing.
DECLARE @AddressLine1 NVARCHAR(70),
@AddressLine2 NVARCHAR(70)
SELECT TOP 1
@AddressLine1 = NULLIF(l.i_address1, ''),
@AddressLine2 = NULLIF(l.i_address2, '') FROM mytable
From there I'm doing more processing down the line. I haven't had an issue with importing the data until I started doing imports with data in the Amharic language. An example would be the value "ወደ አደረገ፣ አድራሻ ጻፈ".
When I use NULLIF on values such as that, the value gets dropped to an empty string and the variable gets a value of NULL. If I don't use NULLIF, the variable gets assigned the string. The only way I've been able to find a fix for this is when I collate the field to Latin1_General_BIN. (NULLIF(l.i_address2 COLLATE Latin1_General_BIN, ''))
My thought and question remains though... why does that specific string and other strings in the Amharic language break when using a string comparison function against it?
There's no hidden whitespace or characters and no leading/trailing spaces.