Sunday, February 19, 2012

import .sql file into mssql

I have backup.sql created by mysql. How can I let mssql server to import such file?Well, assuming it's a dumpfile created from mysql, you need to attach it to a mysql server and use ODBC to connect and import from it. If it's just a SQL file, which I seriously doubt, then you can just open it up and run it from Query Analyzer provided it only used ANSI sql, which again I seriously doubt if it's mysql.|||Look inside the file. If it is an .sql file, it probably contains SQL statements ... in the MySQL variant of the language which may or may not be compatible with MS-SQL. (Also, it may contain statements like DROP TABLE that you might not want to execute, so I say again ... look first!)

If the file contains SQL statements, the information is processed by executing the statements. A "mysql dump file" is most commonly in this foramt.

It's also possible that the file contains only data, possibly in some format like comma-delimited-ASCII. Such information is handled in other ways, and the correct treatment will be indicated based on what you actually find in the file.|||Thanks a lot. I did it over ODBC connection to MySQL and it is fine. I didn't work with MSSQL for a long time so I forgot completely to ODBC,..
But again thanks a lot.

No comments:

Post a Comment