December 9, 2007 at 6:00 am
is there any way to change the Unicode datatype NVarchar to Varchar?
December 9, 2007 at 12:40 pm
varchar is not Unicode.
You can change the data type, but any unicode data would be lost or cause errors during the conversion. Only the N data types (ntext, nvarchar, nchar) accept Unicode data.
December 9, 2007 at 1:43 pm
I know that varchar is using ASCII. And just want to know if there is way for conversion because using cast is not correct. Thanks!
December 9, 2007 at 2:56 pm
Why CAST is not correct?
_____________
Code for TallyGenerator
December 10, 2007 at 5:39 am
use cast will result in ???
December 10, 2007 at 7:28 am
CAST is not a translater. Meaning if you have a Japanese kanji character in Unicode, SQL Server has no way to CAST that to varchar. You're asking to somehow translate two bytes into one and there are no rules for that.
If you store a "ABC" in Unicode (NVARCHAR) and CAST that to VARCHAR, it will work because the top byte is all zeros. CAST works. If there is data from a non-ASCII character set in the upper byte, you CANNOT cast it.
CAST works fine if you are storing ASCII characters in the Nvarchar and just want to change the column type.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply