How to convert Binary data to text data?

18,829

I can't beleive nobody answered this. If it's image data you won't get anything readable. but in case it is text data in a binary field, you can do this:

select cast(DataColumn as varchar(MAX)) as DataAsText from [TableWithData];
Share:
18,829

Related videos on Youtube

user3682923
Author by

user3682923

Updated on September 15, 2022

Comments

  • user3682923
    user3682923 over 1 year

    How to convert binary data to text?

    I have column called File names in test table with image datatype so when i am selecting the data from test table its showing the data for file names column is binary data i.e ('0x433A5C55736535').

    Regards Anji

  • CDahn
    CDahn almost 10 years
    It's the hex representation of binary data.
  • Syed Aqeel Ashiq
    Syed Aqeel Ashiq about 2 years
    I also sometimes get amazed at how SO community behaves. Can somebody explain why a simple, clear, and specific question like this wasn't answered for 7 years?