> ## Content Index
> Fetch the complete content index at: https://helpmonks.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Each database its own unique generator
- URL: https://helpmonks.com/blog/each-database-its-own-unique-generator/
- Published: 2012-11-23T00:00:00.000Z
- Updated: 2026-04-04T01:57:39.000Z
- Description: Don't you love that every major database on the planet thinks that we (as in developers) don't need to have a common syntax and that we should spend hours lo
- Author: Nitai
- Tags: email marketing

Don’t you love that every major database on the planet thinks that we (as in developers) don’t need to have a common syntax and that we should spend hours looking for the needed functionality?

Well, it just so happens that I was in need for generating a unique ID today with the database function – also know as UUID. A UUID is a string that is unique and looks something like “0302B2FE-8046-45D1-AB584481D0F2A99E”.

So, without further due here are the different functions for:

**MySQL**  
\[code\]SELECT uuid() FROM …\[/code\]

**MS SQL**  
\[code\]SELECT newid() FROM …\[/code\]

**DB2**  
\[code\]SELECT generate\_unique() FROM …\[/code\]

**Oracle**  
\[code\]SELECT sys\_guid() FROM …\[/code\]

**H2**  
\[code\]SELECT random\_uuid() FROM …\[/code\]

Yep, that’s right. Each function is named completely different, so it was not so easy to find them as quickly as I thought. In any case, hope this helps.