I have .mdf file (MS SQL backup) and i want to convert it to .sql. So I dont want to use MS anymore but Mysql.Is there a way to convert the .mdf file to sql? Perfect would be if it also recreates the relations etc.
thanks.
b0ssb0ss
1 Answer
mdf is the binary file of a database. The tool that allows you to access the data in a mdf file is SQL Server. There are no other tools to work with these files -- there are many tools which allow you to export the data and structure of a SQL Server database and they are all included in the SQL Server product. In the UI you can select 'script database'. There are also ways to export tables.
HoganHogan
56.4k10 gold badges68 silver badges104 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged mysqlsqlconverters or ask your own question.
I'm working on a project that has to be turned in tomorrow. For this project I use a SQL Server Express database running on a remote server.
Now, I need to generate a
.mdf
file from the remote database. I have searched everywhere, and I can not find a proper solution.
I have scripted the database to a
.sql
file, but I can't find a way of executing it against a local .mdf
file. Either I can create a .sdf
which will not work, or connect to a database engine.
Help will be greatly appreciated!
marc_s
595k135 gold badges1139 silver badges1280 bronze badges
thilemannthilemann
2 Answers
.mdf
is the SQL Server's datafile format.
Sql To Mdf
So you need to these steps:
- connect to your local server
- create a new database
- run the
.sql
script against it - detach that database
Now, after all the steps, you can copy the resulting
marc_smarc_s
.mdf
file from the SQL Server data directory to somewhere else.
595k135 gold badges1139 silver badges1280 bronze badges
No you can't generate an MDF file from the remote database.
You can create a local database with a script like this:
You can create a local database with a script like this:
And then run you sql script to create tables and populate them with your data.
After this you have two options.
After this you have two options.
- Repeat the procedure on your customer machines
- Detach the database and get the MDF and LDF file to your customer,then try to reattach it
(Of course this assumes the two SqlServer use the same version)
SteveSteve
186k16 gold badges169 silver badges226 bronze badges
Not the answer you're looking for? Browse other questions tagged sql-server or ask your own question.
[FAQ] [Tutorial] [Release Notes] [Download] [Buy] Latest version 7.3 released 06/11/2018 |
MySQL-to-MSSQL is a program to migrate MySQL databases to Microsoft SQL server. Command line support allows to script, automate and schedule the conversion process.
Features
|
Limitations
- Does not convert stored procedures and triggers (our specialists can convert these objects manually as Database Migration Service)
- Demo version converts only 50 records per table
- Demo version does not convert queries/views and foreign keys
Requirements
- Supported OS: Windows XP(SP2 or SP3)/2003/Vista/Server 2008/7/8/10, Linux with WINE
- MS SQL environment (server or client components of MS SQL must be installed on the same machine where you run MySQL-to-MSSQL from)
- Necessary privileges to write into the destination database
Add Mdf To Sql Server
Customize table structure
Manual table structure customization can be accessed by double click on the corresponding table name in 'Selected tables' list of 'Step 4 of 6' wizard page.
This will cause the following dialog box to appear:
To customize type mapping select the appropriate item in the listview on the left and specify new name, type and default value for the field using 'Field info' group of controls. Please note that listview on the left contains column attributes of the original types mapping, new custom types and attributes will be displayed in 'Field info' controls when the corresponding item is highlighted in the listview.
Export into T-SQL script file
It is not always possible to have direct access to Microsoft SQL server. For this cases MySQL-to-MSSQL converter allows users to do indirect conversion and get more control over the process. Following this way, the program exports MySQL data into a local T-SQL script file instead of moving it to MS SQL server directly. This file contains SQL statements to create all tables and to fill them with the data. Click here to learn how to import T-SQL script file into MS SQL server.
We have bought MSSQL-to-MySQL and MySQL-to-MSSQL. We love your products and support. We would give A+++++ for your Product and Support. Thank you Very Much..You guys make our life easy..
Pankaj Shyani, ec2 Software Solutions
Pankaj Shyani, ec2 Software Solutions
These converters have saved me many hours of work and have converted millions of records of data flawlessly. The quality far exceeds the price that you charge for the programs.
Robert Lyons
Robert Lyons
Quick Lauch
Once you stored conversion settings into profile you can run the program in Quick Launch mode. Just launch Windows Explorer and double-click on the profile description (.s2m) file with left mouse button. This will cause MySQL-to-MSSQL wizard to launch conversion loading the necessary settings from the specified profile. Then you will be taken right to the screen with progress of conversion without entering all conversion settings.
Synchronization
Convert Mdf To Sql
MySQL-to-MSSQL implements synchronization as combination of insert MySQL records that are missing in MS SQL table and update existing MS SQL records with MySQL data. For synchronization purpose source and destination tables must have identical structures and have primary key or unique index defined. It can take some time since the program scans entire source and destination tables in order to find all rows that have been changed.
If you need more options to configure the synchronization or want to reduce duration of the process via 'incremental' technique, take a look at MSSQL-MySQL Sync, special product to synchronize MS SQL and MySQL databases.
Try before you buy
Still not sure the program fits your needs? Try free demo version with limited features. It will allow you to convert only five records for each database table, it does NOT convert queries/views and foreign keys. Test the quality of the demo and come back to place an order if satisfied with the results.
How to disable windows installer. From all that has been highlighted here I am glad that after I had to 'recover' Windows 8 from a disastrous 8.1 foray I think I'll stop with 8 as no mention of forcing me to upgrade has appeared after I got rid of the annoying KB upgrades that kept pushing the new win 10. Now my wife's laptop came with 10 pre-installed and has now decided she cannot open Excel files after she bought and paid for the subscription to office 365. Twice the support techies have re-installed the program and assured me that it is 100% fixed only for it to go back to not working after re-booting the comp. At least on 8 I could disable them from installing.
Ordering
For online credit card purchasing select a suitable option in the table below and click the corresponding 'ORDER NOW' link. To learn about alternative payment options please visit our Ordering Page. MySQL-to-MSSQL is covered by 30 day money-back guarantee
MySQL-to-MSSQL order single product |
$49 | ORDER NOW |
MySQL Migration Toolkit software pack to convert any data source to MySQL and vice versa |
$99 | ORDER NOW |