I am trying to convert a database column DATA
from varbinary()
to varchar(max)
in SQL Server 2012.
I am using this code to han
try NVARCHAR
Select convert (NVARCHAR(max),DATA) FROM [dbo].[TABLE_NAME]
EDIT:
SQL Server does not support handling of UTF8. To convert your binary value you have to write you own function. The easiest way to do that is to use CLR.
You can use this as a model: How to return an nvarchar(max) in a CLR UDF?
Just replace the regex code with the Encoding.UTF8.GetString