Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 open Mysql File

Author  Topic 

jscot
Posting Yak Master

106 Posts

Posted - 2010-12-14 : 16:04:04
Hi gurus, I am in problem, I have MySQL file "MySQL dump 10.11" My question is how i can open this file in SQL Server 2008. I tried to search around through google didn't work out. Thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-14 : 16:20:45
You'll need to figure out if it's a dump file that has a specific format. If it has a specific format, then you can easily use DTS/SSIS/import wizard. You wouldn't need any special driver for that, just need to know the format. If you open the file using Notepad or similar, is it readable and appears to have a format?

If it's a proprietary MySQL file, then you'd likely need the MySQL driver.

I don't know enough about MySQL to answer your question directly, but hopefully I've helped out.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jscot
Posting Yak Master

106 Posts

Posted - 2010-12-14 : 19:47:41
Format is .sql, but how i can use SSIS ?
DATA FLOW TASK ==> OLE DB SURCE ?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-14 : 19:49:14
I don't mean the file extension, I mean the file contents.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jscot
Posting Yak Master

106 Posts

Posted - 2010-12-14 : 19:59:08
Just for make sure, How i can find the format of the file?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-14 : 20:02:43
Open the file with notepad or similar and see if you can spot a format (such as csv, tab delimited, etc...).

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jscot
Posting Yak Master

106 Posts

Posted - 2010-12-14 : 20:35:31
In notepad or excel i can see sql codes (Creating Tables and all stuff) but if i run whole file in sql error and they are not showing any error. Below are the small part of the file

-- MySQL dump 10.11
--

--

DROP TABLE IF EXISTS `test`;
CREATE TABLE `action` (
`id` int(7) NOT NULL auto_increment,
`Id` int(11) NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`sortorder` int(7) NOT NULL default '0',
`closeaction` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-14 : 22:47:53
This is just a normal sql file then. Unfortunately, you are going to need to edit the file manually as the syntax won't work on SQL Server. For instance, auto_increment is identity on SQL Server. You'll need to remove the size for the int data types too.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -