Published · 1 min read

Storing GUID/UUID in a My SQL database

Use the BINARY data type with a size of 16 . This saves the value in binary, thus saving a few bytes.

Use the BINARY data type with a size of 16. This saves the value in binary, thus saving a few bytes.

Use the following if you are trying to insert values to a GUID column using ADO .NET:-

Convert the Guid value to a byte array:-

((Guid)value).ToByteArray()

Partho Sarathi

Partho Sarathi

Founder, Maxotek

Databases

Our blog

Related posts

Tutorials, notes and news from Maxotek.

  • Comparing Schemas

    The Data Comparison plugin of Data Utensil allows you to compare two schemas. Once the comparison is complete, you can see whether a pair of tables are identical, have different columns, are new or…

    Partho Sarathi

    Partho Sarathi

  • Quick Aggregate SQL Result

    A handy feature of Data Utensil is that you can apply aggregate functions (such as Count, Max, Min, Sum, Avg, etc) on a table by right clicking on the column header of the Table Data View .

    Partho Sarathi

    Partho Sarathi

View all posts

See what Maxotek makes

Monitoring, conversion tools and more, built by the same people who wrote these posts.