SQLTeam.com | Weblogs | Forums

How to convert to text in SQL


#1

could you please help me to convert to text
t_text
0x484F442056696C6C61203130204D6F64696669636174696F6E206F66207365616C696E67206265747765656E20646

Return Value

Original Text Will be : Hod villa 10 Modification of Sealing door...

regards
Soofi


#2

You do not seem to have provided the full binary value and the binary you have provided is the wrong length.
Adding an F to the end of your binary text produces:

DECLARE @test varbinary(128) = 0x484F442056696C6C61203130204D6F64696669636174696F6E206F66207365616C696E67206265747765656E20646F;
SELECT CAST(@test AS varchar(128));

#3

full binary value like these i have multiple number of rows. could you please help me how to convert to text


#4