If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > UNIQUEIDENTIFIRE equivalent in MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-28-04, 10:29
SKJoy SKJoy is offline
Registered User
 
Join Date: Feb 2004
Posts: 13
Exclamation UNIQUEIDENTIFIRE equivalent in MySQL

Is there any UNIQUEIDENTIFIER data type of MS SQL Server equivalent in MySQL?

And also is there any NewID() function of MS SQL Server equivalent in MySQL to generate GUID values automatically?

I am in trouble, please help me.
__________________
Shahriar Kabir
Reply With Quote
  #2 (permalink)  
Old 09-29-04, 12:41
cristiu cristiu is offline
Registered User
 
Join Date: Sep 2004
Posts: 46
Yes, you may use in MySQL field as int with AUTO_INCREMENT flag
Reply With Quote
  #3 (permalink)  
Old 09-29-04, 12:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
cristiu, that will not generate the values that SKJoy is looking for

GUID values look like this: {3F2504E0-4F89-11D3-9A0C-0305E82C3301}

see http://en.wikipedia.org/wiki/GUID

SKJoy, i'm afraid there is no joy for you, mysql doesn't support them
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 09-29-04, 12:54
SKJoy SKJoy is offline
Registered User
 
Join Date: Feb 2004
Posts: 13
You are right r937, I am looking for something like MS SQL Server does as UUID. Here is a mail reply that I've got from Arthur Fuller due to the fact:
Quote:
Unfortunately, there is no such datatype in MySQL. I have been researching the theory and practice of GUIDs but have not developed a routine yet that will enable their manufacture as easily as NewID() does in MS-SQL. It's on my to-do list, however.
By the way, I managed to accomplished it through PHP function $MyGUID = md5(uniqid(rand(0, 1000),1)); that returns stuff like '0cd7b66f936684b913562149e6e49034', but I am not certain if it guarantees to be unique like MS SQL Server.
__________________
Shahriar Kabir
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On