Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Invisible Charcters in nvarchar Column

Author  Topic 

shadychima
Starting Member

3 Posts

Posted - 2013-10-03 : 03:33:03
Hi,
I have a table with NVARCHAR(20) type column to store phone numbers. I am not able to process the data from this column as the code throws error : 'Input string was not in a correct format.'
When I query the table data, it appears fine. But as I copy paste the column data from SSMS result grid to Query Editor window, it paste -- charcters in addition to data. E.G. Data which appears '0121 4590518 ' in the grid, when I paste it on Query editor window is shown as '0121 4590518-'.
Not sure is there a problem in column data type or the data.
Any help is appreciated.
Thanks in advance.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2013-10-03 : 04:20:53
Have a look at the Unicode data.
Get it into a variable then look at each character in turn.
The applications have to interpret the data for display and probably as something isn't in the standard character set they are mapping it differently.

I have seen errors created by .net applications which have the wrong datatype for columns and it manages to get invalid data into strings - that usually causes an error accessing the data rather than incorrect data though.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -