Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to view/edit numeric column in hexadecimal format

Status
Not open for further replies.

jadn

Programmer
Oct 28, 2005
23
US
Hello,
Sorry for this trivial question - hope I chose right forum...

I'm manually editing a database/table in the "Sql Server Enterprise Manager". One of the columns is "int" type. This int is used bit-wise and it would be very helpful to view/edit column data in a hexadecimal format.

How to?

Thanks!
 
Jadn,

Unfortunately while there are ways to convert hexadecimal data to SQL datatypes, I don't know of any way to convert SQL datatypes to hexadecimal.

Sorry.



Catadmin - MCDBA, MCSA
"The only stupid question is the one that *wasn't* asked.
 
Thanks Cat.
I'd have thought that when entering a value, the UI could have parsed a number entered as "b01101", or "xFF", or "d123" (of course I tried this first.) After-all, the UI figures-out a number entered as "1E3" ok! Oh-well, maybe seperate byte columns are "better-form" than one packed-int column.

Cheers.
 
Jadn,

You do realize that the "1E3" is not a hex number, but a float, right? The E and any + or - signs followed by a number tells you how far to the left or right to place a decimal point. This is a mathmatical standard for large floats and not a hexadecimal specific format.





Catadmin - MCDBA, MCSA
"The only stupid question is the one that *wasn't* asked.
 
Hi Cat, I'm no stranger to exponential-notation - just whining! ;^)
In order to convert "1e3" to 1000, some string-parsing/entry-validation is going on behind the scenes - so the opportunity is there (at some level) for interpreting numeric-column entries in other numeric bases besides Decimal.

Cheers!
 
Jadn,

Just found out something really interesting. The conversion you're looking for may be available in SQL 2005. Since custom datatypes are depreciated and we can now use .Net class CLR types to build actual assemblies to do all sorts of things (including arrays), you might be able to use this when you upgrade to get your Hex info.



Catadmin - MCDBA, MCSA
"The only stupid question is the one that *wasn't* asked.
 
Cool! Will keep my ears-open for possibility to upgrade to SQL 2005.

Much Obliged!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top