2015-08-20 64 views
-1

0x07FD0707FD005400610062006C00650049006400000001D4FF0000FF0707FD00520065006300490064000000317EF0005001000000FF0707FD0050006100720074006900740069006F006E000000310000005001000000FF0707FD00720065006300560065007200730069006F006E0000000101000000FF0707FD00730065007100750065006E00630065004E0075006D000000317EF0005001000000FF0707FD0064006100740061004100720065006100490064000000006400610074000000FF0707FD006300720065006100740065006400420079000000006400620061006C0061006300680061000000FF0707FD00640045004C005F004300720065006100740065006400540069006D006500000001BB8F0000FF0707FD0063007200650061007400650064004400610074006500540069006D00650000000672091B110D0F000089900000FF0707FD006D006F00640069006600690065006400420079000000006400620061006C0061006300680061000000FF0707FD00640045004C005F004D006F00640069006600690065006400540069 006D006500000001BB8F0000FF0707FD006D006F006400690066006900650064004400610074006500540069006D00650000000672091B110D0F000089900000FF0707FD00410073007300690067006E006D0065006E0074004D006F00640065000000FC0152006F006C006500410073007300690067006E006D0065006E0074004D006F00640065000000FF0707FD00410073007300690067006E006D0065006E0074005300740061007400750073000000FC0152006F006C006500410073007300690067006E006D0065006E0074005300740061007400750073000000FF0707FD005300650063007500720069007400790052006F006C006500000031B8380B0000000000FF0707FD0055007300650072000000006A006E0067000000FFFF16進制值的字符串在SQL

這是16進制值我有,我不能將它的字符串,它不是像普通converstion我需要幫助! 在此先感謝。

+0

但是,爲什麼?十六進制字符串包含什麼樣的數據? – jarlh

+0

它是unicode文本,意思就像「我能夠自己創建自己的數據」一樣。創建數據庫1創建數據創建數據1創建數據創建數據創建數據B ydbalachaÿýd EL _ C re「 – Shnugo

回答

1

您可以使用轉換是這樣的:

declare @hex varbinary(max) = 0x07FD0707FD005400610062006C00650049006400000001D4FF0000FF0707FD00520065006300490064000000317EF0005001000000FF0707FD0050006100720074006900740069006F006E000000310000005001000000FF0707FD00720065006300560065007200730069006F006E0000000101000000FF0707FD00730065007100750065006E00630065004E0075006D000000317EF0005001000000FF0707FD0064006100740061004100720065006100490064000000006400610074000000FF0707FD006300720065006100740065006400420079000000006400620061006C0061006300680061000000FF0707FD00640045004C005F004300720065006100740065006400540069006D006500000001BB8F0000FF0707FD0063007200650061007400650064004400610074006500540069006D00650000000672091B110D0F000089900000FF0707FD006D006F00640069006600690065006400420079000000006400620061006C0061006300680061000000FF0707FD00640045004C005F004D006F00640069006600690065006400540069006D006500000001BB8F0000FF0707FD006D006F006400690066006900650064004400610074006500540069006D00650000000672091B110D0F000089900000FF0707FD00410073007300690067006E006D0065006E0074004D006F00640065000000FC0152006F006C006500410073007300690067006E006D0065006E0074004D006F00640065000000FF0707FD00410073007300690067006E006D0065006E0074005300740061007400750073000000FC0152006F006C006500410073007300690067006E006D0065006E0074005300740061007400750073000000FF0707FD005300650063007500720069007400790052006F006C006500000031B8380B0000000000FF0707FD0055007300650072000000006A006E0067000000FFFF 
declare @string nvarchar(max) 

set @string = Convert(nvarchar(MAX), @hex, 1) 
select @hex, @string 
+0

但是最後的」1「不會帶回字符串,這似乎是OP想要的... – Shnugo

+1

我不是跟着你嗎? –

+0

嗯,我試了一下(設置查詢輸出到文本):選擇CONVERT(VARCHAR(MAX),@ hex,1)返回「0x07FD0707FD0054 ....」並選擇CONVERT(VARCHAR(MAX),@hex)帶着「T T I IÿÿR R I d comes ...」。 (編碼問題) – Shnugo

相關問題