convert from uniqueidentifier to int?
how?
please help
January 7th, 2009 9:43am

why you need this convert?At 16 bytes, the uniqueidentifier data type is relatively larger than other data types, such as 4-byte integers. So I am afraid you can not convert fromuniqueidentifier to int?
Free Windows Admin Tool Kit Click here and download it now
January 7th, 2009 9:50am

I can think of one way of doing so, but Ican't think of any reason why you'd want to do this!!
Please bear in mind that this may not behave how you expect (i.e. don't expect for this to return unique values everytime)

SELECTConvert(int,Convert(varbinary(36),NewID()))
January 7th, 2009 6:09pm

select CONVERT(UniqueIdentifier,cast(0 as varbinary))
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2013 5:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics