I want to store an unique ID in my MySQL databse, but I need to know how long the X in varchar(X) should be.
The character length I need is 36 characters, example of an unique ID I use: 883db600-3512-4124-8cd5-5bd051f137fe
I want to store an unique ID in my MySQL databse, but I need to know how long the X in varchar(X) should be.
The character length I need is 36 characters, example of an unique ID I use: 883db600-3512-4124-8cd5-5bd051f137fe
If it is always 36 characters long then use
char(36)
if it can be shorther then
varchar(36)
A typical guid is 38 bytes (if you are counting the curlies).
More info: How many characters are there in a GUID?
char(38) or char(36)