I have a nvarchar(255) column which store numbers imported from excel long time ago.
Format like below:
7,242
(4,011)
-
(24,120.2)
-
4,234,091
"-" means 0 here.
I'm currently using "replace" to make it converted to decimal
convert(decimal(18,4),RTRIM(LTRIM(replace(replace(replace(replace([Column a],'-',0),',',''),'(','-'),')',''))))
Anyhow, I think it is a little bit stupid. Any better way?