NEWID Function - SQL Server to MySQL Migration

In SQL Server, the NEWID function generates an Universal Unique Identifier (UUID) of UNIQUEIDENTIFIER data type. In MySQL, you can use the UUID function that returns a UUID as a string.

SQL Server:

  -- Generate UUID
  SELECT NEWID();
  # 63579ACA-AE07-4290-9BAF-A72261B5FC44

MySQL:

  -- Generate UUID
  SELECT UUID();
  # 63579aca-ae07-4290-9baf-a72261b5fc44

For more information, see SQL Server to MySQL Migration.