Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    13

    Exclamation Unanswered: 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

  2. #2
    Join Date
    Sep 2004
    Posts
    46
    Yes, you may use in MySQL field as int with AUTO_INCREMENT flag

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    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:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •