Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
challapavan
Starting Member
8 Posts |
Posted - 2008-09-26 : 10:27:35
|
| How to convert a negative Decimal Integer to varchar Hexadecimal.Please find the attached sample.If we convert -1048284 to Binary we will get 1111111111111111111111111111111111111111111100000000000100100100.And converting this to Hex value will give us: FFFFFFFFFFF00124Thanks in advance.....pavan |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-26 : 10:31:16
|
[code]DECLARE @Sample INTSET @Sample = -1048284SELECT CAST(@Sample AS BINARY(4))[/code] E 12°55'05.63"N 56°04'39.26" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-26 : 10:36:15
|
[code]DECLARE @bigSample BIGINT, @intSample INTSELECT @bigSample = -1048284, @intSample = -1048284SELECT CAST(@bigSample AS BINARY(8)) AS [64-bit], CAST(@intSample AS BINARY(4)) AS [32-bit][/code] E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|