Exporting from MySQL and importing into Microsoft SQL - mysql

I exported a MySQL DB, both structure and data, using PHPMyAdmin, with the option of exporting it as MSSQL compatible single file: mydb.sql
The resulting file is large (about 2GB).
I have a DB set up on a Microsoft SQL Server.
How do I import the mydb.sql file, into the Microsoft SQL Server? I installed the Microsoft SQL Server Management Studio, and was able to use it to connect to the Microsoft SQL Server, and connect to the DB, but I can't figure out how to use it to import mydb.sql, to create the table and data.
Any ideas?

Choose File->Open from SSMS menu.
Pick your SQL file.
Once the file is loaded be sure that you are in the context of your database.
Click Execute button.

Related

.bak file from MYSQL to MS SQL SERVER

I have got a .bak file of mysql database created using Linked server concept, the MYSQL Database has been accessed through SQLServer Instance. I wanted to import that to SQLSERVER 2019 database.
Is it same as a normal restore process or Is there anything I have to be careful about?

Create MySQL database from .mdf and .ldf files from SQL Server 2008

I have some .mdf and .ldf files of database size greater than 10 GB with me.
I want to create a MySQL database using the same.
Is there any provision in MySQL to do it?
Please consider that MySQL and SQL Server 2008 can not be installed on the same machine (or even the same network) in my current setup.
I don't have enterprise edition of SQL Server management studio in our network and will not be able to install it.
Is there any other elegant way to export data from SQL Server 2008 and import it in MySQL?
I don't think it is possible without attaching.
If you find a way how to attach it, you can use some specific migrating tools like this.
Some tools allow to create database specific queries from another solution, that need to be only executed on your side.
The MDF and LDF files belong to Microsoft SQL Server and use Microsoft's own binary format, so you cannot connect these files to other database management systems. The only approach I can think of, is to script out the database code and data from the SQL Server database to a text file (.sql file), and import this file into MySQL.

Connect to a MySQL database via Excel online

We build and deploy excel 'tools' which run queries in VBA from an Access database. However, we want to make this tool available to a client without sending them over an entire database along with the excel file.
Q. Can we store a read-only database online, using MySQL or even SQL Express, and allow any machine with our Excel file (and connection setup) to access this? I.e. we want our Excel file to connect to a 'cloud' database
Background: I've used PhpMyAdmin to connect and query databases, but this has always been in a local development environment.
I think you would use a connection string in Excel to connect MySQL or SQL Express:
In Excel, go to Data, Connections, Add:
MySQL: Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
SQL Express: Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;
Pwd=myPassword;

Convert a .bak file to .sql file

I have a asp script that I'm intending to write it with PHP so I have to get its database and use it.
I have the database as .bak file which I understood that it's a backup and I wanna change it to be .sql to import it in phpMyAdmin
I read about this matter in the web but I didn't find an accurate tutorial that goes through the whole process.
They are talking about mssql database but I didn't even reach this step..
Any help will be highly appreciated. Thanks in advance :)
Note, all of this applies to MS SQL because .bak is a usually a MS SQL backup.
A .bak can't be converted to SQL directly -- it contains a backup of a database which does not have a clear relationship to SQL.
You could restore the backup and then use SQL Server tools and then use that to make some SQL to recreate the SQL server objects but not the dat.
From SQL Server Management Studio: Datbases item, right click "Restore
Database" then from datbase right click script database.
This won't script the data.
The other option is to use RedGate's excellent tools, which should do everything you want.
http://www.red-gate.com/products/sql-development/sql-toolbelt/
Most probably the .bak file is indeed a binary backup of a Microsoft SQL Server database (which is something completely different than MySQL).
So you will first need to install Microsoft SQL Server (Express) together with the SQL Server Management studio (I think there is a bundled download "SQL Server Express including Tools".
In the Management Studio you can then import the .bak file into a new database. Once the import is finished you can use it to create SQL script out of the database.

How to import a MS SQL server table into mysql?

I need to export about 300,000 rows from a table on MS SQL server and import into mysql on a different server (non windows).
There is some text stored in some fields and commas in the text will mess up the format if I export into txt format.
I can't install any software on the server.
You may have several options:
use SSIS or DTS Wizard on another host to interconnect MSSQL and MySQL
write your own small app to move the data
script the MSSQL DB's DATA into script file with SSMS' scripting features, adopt the script manually to mysql and run it
I'm pretty sure you can connect to MySQL from SSIS. I'd go down that route.