Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2010, 01:17 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Decode varbinary data.

Hi,

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 .
 
Old November 16th, 2010, 03:51 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Did you try converting using NVARCHAR?

It's hard to tell what's happening with your code unless you post the Varbinary value.
__________________
--Jeff Moden
The Following User Says Thank You to Jeff Moden For This Useful Post:
rupen (November 16th, 2010)
 
Old November 16th, 2010, 04:31 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

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'
 
Old November 16th, 2010, 11:11 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

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

Last edited by Jeff Moden; November 16th, 2010 at 11:37 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Varbinary(max) performance issue musman0047 SQL Language 0 May 8th, 2008 08:20 PM
Storing data in a varbinary field in SQL mswombat Java Basics 2 February 9th, 2007 08:03 AM
retrieve varbinary using StoredProc with OUTPUT ag19702004 ADO.NET 0 November 30th, 2005 01:37 PM
ASP.Net (Varbinary) s_chirags ADO.NET 0 September 13th, 2003 04:18 AM
decode loop lneilson Beginning VB 6 1 August 6th, 2003 12:32 PM





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