Migrate MySQL to Microsoft SQL Server
February 2, 2011 1 Comment
Hi Friends to my post how to convert the mysql database table to sql server database table.
steps:
1.Install mysql database and configure through the control panel–>Administrative Tools–>Data Sources (ODBC)–>User DSN–>Add–>Mysql ODBC 5.1 driver–>Finesh.
2.open sqlserver 2005 query browser execute below sql code
EXEC master.dbo.sp_addlinkedserver @server = N'MYSQL', @srvproduct=N'MySQL', @provider=N'MSDASQL', @provstr=N'DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; _ DATABASE=tigerdb; USER=root; PASSWORD=hejsan; OPTION=3'
3.In sqlserver 2005 query browser object explorer-Service objects–>Linked servers–>Now you can find the Mysql property.(if u not get refresh database)
4.Now create one sample database and execute the below code
syntax:
SELECT * INTO sqldatabasename.dbo.sqltablename FROM openquery(MYSQL, 'SELECT * FROM mysqldbname.mysqltablename') example: *Here my database name is sample.table name is employee. create database sample.
SELECT * INTO sample.dbo.employee FROM openquery(MYSQL, 'SELECT * FROM tigerdb.shoutbox'). That's it. enjoy coding. any doubt comment me.