October 3, 2006 at 9:09 am
Hi,
I have a customer database that has several fields that are in SQL with the data type of Binary(100 chrs). The data is shown with the client app as normal text. I want to read the text values in these fields but cant figure out how to see the data as ASCII. One of the fields is a normal part description field. Dont know why the vendor set that as the field data type. I have tried cast and convert but only a single number is shown in the result set. Any help would be appreciated.
This is a sample of the binary data for the PartNbr field 0x3800370031003300390039002D00300030003100300035002E003200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 This should be a part number like 850306-00803. They also have the Unit of Measure and many other fields as Binary. Here is an example of the Unit of Measure field that should be = Ea or Each 0x45004100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
Thanks in advance
David
October 3, 2006 at 10:18 am
Try
CAST([columnname] as nvarchar(100))
Far away is close at hand in the images of elsewhere.
Anon.
October 3, 2006 at 10:33 am
Works Great! Thanks for the advice.
David
October 3, 2006 at 10:04 pm
And they say understanding underlying data structures is no longer important... the '00' unicode country code in these examples sticks out like a sore thumb to anyone who has seen it before... Nice job, David.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 4, 2006 at 1:49 am
...the '00' unicode country code in these examples sticks out like a sore thumb... |
Thanks Jeff
It's what you get for working in hex for so long
Must be all that work I did in Assembler in the good old days
Far away is close at hand in the images of elsewhere.
Anon.
October 4, 2006 at 5:02 am
You had an Assembler? Lucky you... Much of the code I wrote in the "good old days" was hand-assembled machine language... now THAT was fun Now adays, I don't think they even teach numbering systems in college. I interviewed 4 folks with Master's Degrees and 1 PHD... all of them in Computer Science... none of them could tell me what 20 or 1416 was. Two of them didn't even know what 23 was. Forget any Boolean Algebra... guess the old T-Shirt was right... "There are 10 types of people, those who understand binary and those that don't."
--Jeff Moden
Change is inevitable... Change for the better is not.
October 4, 2006 at 6:28 am
After I Saw Davids answer, I gave my head a good slap because I knew better; I had even started writing a function when David posted the right answer.;
Lowell
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply