p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   Decode varbinary data. (http://p2p.wrox.com/showthread.php?t=81591)

rupen November 16th, 2010 01:17 AM

Decode varbinary data.

How do we decode the text stored in a column with [varbinary] data type.
I tried with select convert(varchar, [columnname]) but the output is creepy it is " èl÷[Äþ4!]Æ2à'膁–\ë6×y'ÞÈã".
Thank you [:)].

Jeff Moden November 16th, 2010 03:51 AM

Did you try converting using NVARCHAR?

It's hard to tell what's happening with your code unless you post the Varbinary value.

rupen November 16th, 2010 04:31 AM

I tried with NVARCHAR, the result is it displays 18 square boxes.

The varbinary value is:
0x0C1CE86CF78D5BC413FE34215DC611327FE09D27E8868196 5CEB36C3971B791527DEC8E3

I am trying in sql query analyzer as :

SELECT convert(nvarchar(256),UserPwd)
FROM [User]
WHERE UserName = 'testuser'

Jeff Moden November 16th, 2010 11:11 PM

Ummm.... passwords use hashing in that table. Pardon the pun but a simple conversion isn't going hack it.

All times are GMT -4. The time now is 11:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.