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 |
|
iliad
Starting Member
2 Posts |
Posted - 2009-01-14 : 06:35:03
|
Hi!I would like to have the HEX value of a GUID but something is going wrong. I'm very new to this and have googled already, but no success.print cast('5CB06756-3D58-41CD-AFAC-CAEFFE71C60E' as binary(16))--> 0x35434230363735362D334435382D3431print cast(0x35434230363735362D334435382D3431 as uniqueidentifier)--> 30424335-3736-3635-2D33-4435382D3431I take the '5CB06756-3D58-41CD-AFAC-CAEFFE71C60E' as a starting point, then I convert it to a hex and convert it back to a GUID. But I get '30424335-3736-3635-2D33-4435382D3431' instead of the original value. What is wrong?Thanks for helping! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
iliad
Starting Member
2 Posts |
Posted - 2009-01-14 : 09:41:04
|
| Peso, thx for the quick reply.Could you explain this in a more easy way? Why can I not cast from a GUID to a hex and back?Is 0x35434230363735362D334435382D3431 really the hex value of '5CB06756-3D58-41CD-AFAC-CAEFFE71C60E'? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-01-14 : 10:02:02
|
You can, but you will have to wait for SQL Server 2008. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|