What would be the most efficient data type to store a UUID/GUID in databases that do not have a native UUID/GUID data type? 2 BIGINTs?
And what would be the most efficient code (C# preferred) to convert to and from a GUID to that type?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s hard to say what would be the most efficient without knowing the database you are using.
My first inclination would be to use a
binary(16)column.As for using that value in C#, the
System.Guidtype has a constructor that accepts abyte[]array, and a methodToByteArray()that returns a byte array.