Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 16th, 2010, 01:17 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
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 .
Reply With Quote
  #2 (permalink)  
Old November 16th, 2010, 03:51 AM
Friend of Wrox
Points: 1,536, Level: 15
Points: 1,536, Level: 15 Points: 1,536, Level: 15 Points: 1,536, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: , MI, USA.
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
Reply With Quote
The Following User Says Thank You to Jeff Moden For This Useful Post:
rupen (November 16th, 2010)
  #3 (permalink)  
Old November 16th, 2010, 04:31 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
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'
Reply With Quote
  #4 (permalink)  
Old November 16th, 2010, 11:11 PM
Friend of Wrox
Points: 1,536, Level: 15
Points: 1,536, Level: 15 Points: 1,536, Level: 15 Points: 1,536, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: , MI, USA.
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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:25 AM.


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