SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Converting Hexadecimal String Values to Alpha (ASCII) Strings


Converting Hexadecimal String Values to Alpha (ASCII) Strings

Author
Message
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: General Forum Members
Points: 84791 Visits: 41069
I agree that there're a lot of things, like this conversion, that should be done in the GUI instead of SQL Server. Displaying commas in dollar amounts and formatting dates and the like qualify, as well. That does two very good things... it distributes the "extra" clock cycles to the GUI thereby taking some of the load off of the server and it allows the GUI to format according to regional settings...

... if you have a GUI.

If all you have is batch code, then finding a good high speed answer in T-SQL is worth it. And, no, CLR's aren't the Nirvana of code that everyone is looking for, either. Source code external to the Server must be maintained and they ususally can't beat a properly written solution in T-SQL. Matt Miller, me, and a couple of other folks did some pretty heavy testing against CLR's and the only one that came out better was a RegEx CLR that did replacements (I can't put my hands on the URLs... I'd have to do a search). Of course, just because someone says something like this doesn't mean you shouldn't also do some tests of your own for you own particular situation.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Lashams
Lashams
SSC-Enthusiastic
SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)SSC-Enthusiastic (114 reputation)

Group: General Forum Members
Points: 114 Visits: 48
Agree that presentation software is great for presenting end results data, but in some instances you want to have pre-filtered the results from your database via the underlying SQL. This was why I needed the conversion in the SQL, as I had to filter my table to get just a few rows out of a much larger table, and just present these few rows by the presentation software. I believe doing the filtering in the SQL on the server to be a lot quicker than passing the whole table back to the presentation software to filter it there. Thanks for the feedback.



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search