How to store MS Sql Server uniqueidentifier in MySql table

entity-framework-6 mysql sql-server uniqueidentifier

Question

I have migrated MS Sql Server database to MySql (using MySql Workbench tool) and having some hard time to figure out how to store uniqueidentifier in the table. The tool automatically converts the uniqueidentifier to VARCHAR(64) but I am not sure whether this is correct.

In the web, lot of people are saying we can store the uniqueidentifier as CHAR(36) OR BINARY(16) in MySql so, can someone please tell me which one is correct & efficient to use.

Also, I tried BINARY(16) in a sample table to store GUID but it is not storing the full 32 character GUID instead it stores only the first 16 character and truncates the remaining characters. Please advise.

On the side note, I am trying to consume this GUID in the .Net application using Entity Framework 6 so, will this work fine or will I get any conversion error?

1
0
12/22/2014 4:19:55 AM

Popular Answer

According the the MySQL website you should match it to VARCHAR(64)

UNIQUEIDENTIFIER in MSSQL maps to VARCHAR(64) in MySQL

Click here to check what MySQL says about the same

0
12/22/2014 4:53:19 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow