Previous     Next

Convert MySQL to MS SQL Server Part 2

Following on from my last post on converting MySQL tables to MS SQL, here is the code to convert Insert SQL statements from MySQL to MS SQL. Try it out here: The code for this is really simple. Again, if you have any improvements just post the code here and I’ll update the original and give you credit.


        Dim ConvertedSQL As String = ""  

        ConvertedSQL = Me.txtMySQL.Text  

        ConvertedSQL = ConvertedSQL.Replace("rn", "")
        ConvertedSQL = ConvertedSQL.Replace("'", "''")
        ConvertedSQL = ConvertedSQL.Replace("\" & Chr(34), Chr(34))
        ConvertedSQL = ConvertedSQL.Replace("INTO " & Me.txtOldTableName.Text, "INTO " & Me.txtNewTableName.Text)
        Me.txtMSSQL.Text = ConvertedSQL  


If you liked this, then subscribe to my RSS feed

1 comment

  1. G4HQ Apr 28

    Hey if u can email me -> i can turn this into a small vbulletin mod and release on vbulletin.org! Please either add my msn black@ghforum.net or email me at adioviper ;D

Leave a reply