永远的SKYFEI
喜欢在阳光下,光着脊梁,挥汗如雨地工作,每次回头擦汗,看到的都是成就!
posts - 60,  comments - 112,  trackbacks - 3

Use CAST  or  CONVERT  

select convert (varbinary (20) , "select") it gives = 0x73656c656374
then you can convert that to a varchar
select convert (varchar (20), 0x73656c656374 ) it gives "select"

Use master.dbo.fn_varbintohexsubstring(1,@binvalue,1,0)

master.dbo.fn_varbintohexsubstring(1,@binvalue,1,0)

declare @binvalue varbinary(256),
@vcharvalue nvarchar(256)
set @binvalue = 0xF5FF3FED3B055DF7EC27251FBC80EE48
select @vcharvalue = 'aa' + master.dbo.fn_varbintohexsubstring(1,@binvalue,1,0)

print @vcharvalue

it gives = 0xF5FF3FED3B055DF7EC27251FBC80EE48

Use master.dbo.fn_varbintohexstr(@binvalue)

declare @binvalue varbinary(256),
@vcharvalue nvarchar(256)
set @binvalue = 0xF5FF3FED3B055DF7EC27251FBC80EE48
select @vcharvalue = 'aa' + master.dbo.fn_varbintohexstr(@binvalue)

print @vcharvalue

it gives = 0xF5FF3FED3B055DF7EC27251FBC80EE48

posted on 2006-09-13 10:38 skyfei 阅读(1443) 评论(1) 编辑 收藏

FeedBack:
2007-08-02 23:36 | king[未注册用户]
这个有什么用呀
0xF5FF3FED3B055DF7EC27251FBC80EE48
这种值给人看根本就看不懂呀

 回复 引用