sql server - Insert vs Update -


i have table fields declared nvarchar. if insert table unicode characters come fields fine. when update losing of characters. here udpate statement:

update tableii      set    location = cast(( coalesce([city], n'') + nchar(13) + nchar(10)                               + coalesce([installation], n'') + nchar(13)                               + nchar(10) + left(location.latlong, 2) + n'°'                               + substring(location.latlong, 3, 2) + n''''                               + substring(location.latlong, 5, 2) + nchar(34)                               + n' ' + substring(location.latlong, 7, 1)                               + n' ' + substring(location.latlong, 8, 3)                               + n'°' + substring(location.latlong, 11, 2)                               + n'''' + substring(location.latlong, 13, 2)                               + nchar(34) + n' ' + substring(location.latlong,                                                              15, 1) ) nvarchar(max))        tableii             inner join loc on tableii.rec = loc.rec             inner join location on loc.locrecnum = location.locrecnum       ( loc.locseq = '1' ) 

as can see have tried variety of things force unicode characters not lost, not work.

any ideas why insert works fine update not?

is city column nvarchar? if not, coalesce take column it's data type , use it, regardless of rest of code.


Comments