I tried to convert script from MS SQL Server to MySql.
I couldn't find any convenience approach to do this conversion.
I tried this MS SQL Server to MySQL Conversion online converter but it has a lot of mistakes at syntax.
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTITY(1,1) NOT NULL,
`address` varchar(255) NOT NULL,
`date_added` datetime N' at line 2
Here is content of the file that I need to convert pastebin - script
You don't just "convert" TSQL to SQL code for MySQL. You need to know the different datatypes, column constraints, etc. You hit the first of many roadblocks: MySQL uses AUTO_INCREMENT instead of SQL Server's IDENTITY field constraint.
EDIT: There are utilities, but you should still understand what the changes are, as they'll affect many things (including performance and future development against the DB). Duplicate of several other posts (dead link removed).
The converter at http://burrist.com/mstomy.php runs a set of regexps to do the conversion – the regexps list isn’t exhaustive and can be modified as required. I’ve added a couple of extra lines to the standard regexps and it now creates a working version of your script up to the point you start inserting data (it only does tha structure not the data). Hope this is of interest.
Cheers sql-hub.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With