List:General Discussion« Previous MessageNext Message »
From:Larry Lowry Date:May 12 2004 10:54pm
Subject:Re: GUID storage
View as plain text  
A uniqueidentifier in MS SQL is basically a guid.  I am generating
them via System.Guid.NewGuid().ToString(N") in the Dot Net
framework which now returns me a string of 32 characters (hex). 
Internally I understand it is a 128-bit integer.  As an option I could
store that in MySql.  What data type would that be?

How would one convert to binary char(16)?  In what documentation
would I find this?   I do not know enough yet to write a UDF.  

Larry Lowry


----- Original Message ----- 
From: "Dan Nelson" <dnelson@stripped>
To: "Larry Lowry" <Larry.Lowry@stripped>
Cc: <mysql@stripped>
Sent: Wednesday, May 12, 2004 3:10 PM
Subject: Re: GUID storage


> In the last episode (May 12), Larry Lowry said:
> > Well I'm trying to move to MySQL from the MS SQL Server world.  Most
> > data elements are easy except for the uniqueidentifier.
> > 
> > In the MySQL world what is the preferred/best way to store a
> > uniqueidentifier?  The easiest would just be a char(36).
> 
> What is a "uniqueidentifier"?  36 chars sounds like a uuid, in which
> case a char(36) is probably the most transparent.  If you convert them
> to raw form they will fit in a binary char(16), though.  You could even
> write uuid_to_string and uuid_from_string UDFs to simplify conversion.
> 
> -- 
> Dan Nelson
> dnelson@stripped
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 
> 
Thread
GUID storageLarry Lowry12 May
  • Re: GUID storageMike Hillyer12 May
  • Re: GUID storageJeremy Zawodny12 May
    • Re: GUID storageUnknown Sender29 Jun
      • Re: GUID storageDan Nelson29 Jun
  • Re: GUID storageDan Nelson12 May
  • Re: GUID storageLarry Lowry12 May
    • Re: GUID storageDan Nelson13 May
    • Re: GUID storageSergei Golubchik13 May