List:General Discussion« Previous MessageNext Message »
From:Michael McTernan Date:September 24 2004 11:10am
Subject:RE: Need to store a Guid as an Id
View as plain text  
Hi,

> I was able to get the binary storate I needed in a TinyBlob
> but I can't set this to a primary key.

Can be done:

mysql> CREATE TABLE tb
    -> (
    ->   id TINYBLOB NOT NULL,
    ->   PRIMARY KEY (id(255))
    -> );
Query OK, 0 rows affected (0.00 sec)

You need to say how many chars you want the index to run to, max is 255 I
think - check the docs.

Regards,

Mike

-----Original Message-----
From: Daniel Cummings [mailto:DanielCummings@stripped]
Sent: 23 September 2004 20:27
To: MySql List
Subject: Need to store a Guid as an Id


MySql doesn't support Guids but we were attempting to use a VarChar.  We set
the VarChar to binary, but from what I'm reading the binary setting doesn't
affect storage just sorting and evaluations.



I was able to get the binary storate I needed in a TinyBlob but I can't set
this to a primary key.



Is there a work around for this?



TIA



Dan




Thread
Need to store a Guid as an IdDaniel Cummings23 Sep
RE: Need to store a Guid as an IdMichael McTernan24 Sep