Home MySQL Migrating from MS SQL Server to MySQL

Polls

Who administers your corporate database infrastructure?
 

related links:

Migrating from MS SQL Server to MySQL
User Rating: / 0
PoorBest 

I hesitated awhile where to put this article - to microsoft sql server or MySQL section. In the end I decided it more relates to MySQL..

Very often DBA faces the fact that he can't populate his ms sql server database. The reason may be that operational system other than windows or license restrictions etc. In such situation the most popular solution is MySQL dbms.  Because it is absolutely free, cross-platform, open source, available on any hosting and relatively functional/fast.

So you need to get your ms sql server database working on MySQL. This is often much more than simply converting data, you should also migrate your application.

 Migration considerations

First of all, before you start your migration you should consider all details of difference between these database management systems. I mean incompatible features, difference in data types, sql syntax difference, known performance issues etc. After this you will be able to write down your migration plan, that should allways include entire testing phase.

 Data types

Even though there is a lot of similarity in data type names in MySQL and MS SQL Server the data type constratints and even meaning are very often different.

For instance

 Data typeMySQL   Ms SQL Server
 varchar up to 255 characters up to 8000 characters (w/o max keyword)
 text for long strings
 for binary data and full text search
 currency N/A 

 Full list of MySQL data types can be found here and the full list of T-SQL data types here

 Built in function names very. For instance IsNULL of T-SQL corresponds to IfNULL in MySQL and IfNull returns boolean result unlike IsNULL - first or second argument. MySQL engines has much more embedded functions than ms sql does.

There is major difference in User Defined Functions (UDFs). In MS SQL Server UDF is a piece of t-sql code, while in MySQL it is compiled C-code assembly which can be assigned to function name similarly to CLR functions of MS SQL Server.

Only 5.x version of MySQL supports stored procedures, however you will probably need to change you t-sql stored procedures code.

The great feature of MS SQL Server is its maintenance plans. In MySQL you will need to develop your own solutionfor regular backups or use third-party vendors solutions.

There is veriety of tools for MySQL - SQL Server and other side migration.

  • Microsoft SSIS DTS - Sql Server Inegration services or Data Transformation Services (in sql server 2000 and before). Provides grafical interface and is included in ms sql server installation package
  • MSSQL2MYSQL - Visual Basic script
  • SQLyog - commetcial tool
  • Access Export
  • Text Import/Export

Migrate MS SQL Server db to MySQL using SSIS

Firstly, you will need to add your destination mysql server to your source sql server as linked server. For this purpose you will need to install MyODBC driver. You may download it here.

  After considering all restrictions of sql server - mysql migration you might decide to rewrite your database from scratch for mysql which is also a proper solution

Comments (0)

 
SPONSORED LINKS:
Content View Hits : 265861
DB-staff Remote DBA Services, Powered by DB-Staff 2008