Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyphen vs Dash : Replace Dash with Hyphen

Alright so we had a problem recently

In reporting services some of the String Columns were appearing as gibberish Chinese characters.

On further investigation we found it is the hyphen. Well that's what we though first. On further investigation we found it a dash (or en dash) . Basically the reason this has happened is people copy pasting values into this column from word which converts hyphens into dashes automatically.

But if you look at the database they both look the same. Though on the application side you can see the difference.

How do I replace the dash with a normal hyphen.

If you copy the value in put it in SQL server. A hyphen is gray while a dash is black but they both look exactly the same (i.e not bigger or smaller). Problem is I can't write a REPLACE script then (they are the freakin same)

REPLACE ('-' with '-')

is there a way special characters like the dash can be identified in SQL server?

SQL Server v 2005

like image 878
soldieraman Avatar asked May 07 '10 02:05

soldieraman


People also ask

What can you replace a hyphen with?

You can avoid informal punctuation by replacing with a more formal punctuation alternative. Dashes can be replaced by several other punctuations including commas, colons and brackets.

Is there a difference between dash and hyphen?

A hyphen joins two or more words together while a dash separates words into parenthetical statements. The two are sometimes confused because they look so similar, but their usage is different. Hyphens are not separated by spaces, while a dash has a space on either side.

How do you use a hyphen en dash and em dash?

The en dash is approximately the length of the letter n, and the em dash the length of the letter m. The shorter en dash (–) is used to mark ranges and with the meaning “to” in phrases like “Dover–Calais crossing.” The longer em dash (—) is used to separate extra information or mark a break in a sentence.


1 Answers

You can use NCHAR(8211) for the en dash, or NCHAR(8212) for em dash.

like image 177
dan04 Avatar answered Nov 12 '22 23:11

dan04