cancel
Showing results for 
Search instead for 
Did you mean: 

Will altering a column from binary to varchar/nvarchar change the data?

VolkerBarth
Contributor
0 Kudos
2,535

In a table with a column of data type (long) binary, when altering that column to data type (long) varchar/nvarchar, will that somehow convert existing data?

And what happens when doing the opposite, i.e. altering a column of data type (long) varchar/nvarchar to (long) binary?

The v12.0.1. docs tell

"If necessary, the data in the modified column is converted to the new data type."

I'm not sure what defines the necessity here. Is something like csconvert() called here with the according charsets?

(I have stored binary data and would convert the column to nvarchar as the original data is in utf-8, so I hope they will remain as-is.)


Just to clarify: I'm not dealing with varchar/nvarchar conversion...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

You will need to verify this is valid in your situation and that you have valid character data actually stored in your blob columns. but ...

There should be no conversion when you attempt to do this. If you had a requirement to do so you would need to do your own CSCONVERT-style conversions yourself, since only you can know something about the encoding of the raw data stored there. But it sounds like you may not have to worry about that.

Binary object are effectively the "Any" data type and have no meaning or context information associated with them.

VolkerBarth
Contributor
0 Kudos

OK, thanks for the clarification, that's what I had expected, and yes, in my situation the data are valid (i.e. left unchanged) after the data type modification.

Answers (0)