本文介绍了在SQL Server 2005中将Binary(32)数据转换为人类可读的字符串formata的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一张叫的表,其中有一个binary(32)列.

我需要将二进制列数据转换为可读格式

例如
具有以下二进制数据的行之一
0x0000000000000100000000000000000000000000000000000000000000000000000000

实际的字符串是(星期一)

如何编写sql语句,以便通过转换上述二进制值返回星期一".

上面仅是一个示例,但可以是任何二进制值,例如(星期一,星期二,星期三,星期一和星期五,星期一和星期日等.)

在此先感谢您.

Hello All ,

I have one table called which has one binary(32) column.

I need to convert the binary column data into human readable format

for example
One of row having below binary data
0x0000000000000100000000000000000000000000000000000000000000000000

The actual string is (Monday)

How can I write sql statement so that it will return me "Monday" by convert above binary values.

Above is just an example but it can be any binary values like (Monday,Tuesday , Wednesday , Monday and friday , Monday and Sunday ETC..)

Thanks in advance.

推荐答案

CAST(bin AS VARCHAR(50))

,其中bin是您的列.请注意,如果这是加密的,您将无法执行此操作.

where bin is your column. Note if this is encrypted you will not be able to do this.


这篇关于在SQL Server 2005中将Binary(32)数据转换为人类可读的字符串formata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 00:33