473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to convert binary data to string?

1
Hi,

I'd need to construnct an EXEC statement in my script I am pretty much stuck with data conversion. I need to compare a binary variable with a SID value to an actual SID found in ..sysusers.

Whe I construct the EXEC statement the whol line has to be string and I need to find a way to use the binary data as string.

So far, I tryed to play with CONVERt and CAST, but could not succeed.

A simplified version of what I tried to do:

declare @t_sid binary(85)
select @t_sid = 0x01050000000000051500000043170A324D64492E235F636B 18BA0400000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 0000000000000000000000
print convert(nvarchar(10), @t_sid)

This results a nice square character, nothing else...

Any I idea dear expoerts?
Oct 30 '06 #1
2 44638
Convert and Cast definitely won't work in this case. When you store Binary data into table. it does some encryption and then saves encrypted data to table, so how come SQL converts encrypted data to string without knowing the key?
We have to find someother way to decrypt the binary data and then convert/cast.

I ll get back if I find any useful...:)

Deven
Oct 30 '06 #2
here it is..., Stored Procedure to convert.

http://support.microsoft.com/kb/104829
Apr 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: as400tips | last post by:
I have a Binary Data file (Packed Decimal and ASCII mixed) and would like to convert into ASCII (readable) file. How to do it in C#? Thanks.
5
by: rubbishemail | last post by:
Hello, I need to convert a 3 byte binary string like "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). The string might contain characters not escaped with a \x, like "A\x00\x00" ...
1
by: Painy187 | last post by:
Hi guys, i have to code an "interface interpreter" via asp. The Code searchs in a DB for an Identcode, puts this Code in a XML-Structure, sends (XMLHTTP) this structure to an other server and...
0
by: chaitanya02 | last post by:
Hi All, Could we generate a URL reading binary data from the SQ server 2000? I have a couple of DVD's which could be stored in binary format in SQL server. i want these binary data to be read...
1
by: sarbeswar | last post by:
How to convert binary data to text format in visual basic 6
1
nirmalsingh
by: nirmalsingh | last post by:
hai all, i saved a word document into sql server database, now it is in the binary data format in database, now i want to retrieve it and show in word document again. plz help me to do this....
1
by: Swan | last post by:
I am sending binary data from ASP to dll in VB.I am able to receive the data,but it is in binary format.can anybody plz tell me how to convert binary data to original text in VB.(I am saving data in...
11
darksteel21
by: darksteel21 | last post by:
Hi All, I am currently developing an application that reads data from PC's Memory. It is working but the output is something like this: (Please see attached..)...
0
by: karthikakiruthi | last post by:
I retrieve the binary file from a table and then i wand to convert the binary file to a text file in a readable format and display it in a webpage? How can i perform this?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.