Question

Locked

How do I creating a new database using an MDF file?

By samuelconaghan ·
Tags: Windows, Software
My database saves as MDF. I want to know what are the steps to restore or create a new database using a MDF file? I tried to restore as usual but it shows an error. Please help.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

An MDF file isn’t a backup file isn’t the main data file

by jackoboyle51 In reply to How do I creating a new d ...

An MDF file isn’t a backup file isn’t the main data file (or master data file depending on who you ask) hence the file extension MDF. You can attach the MDF to the database by right clicking on the databases folder in Enterprise Manager (SQL 2000) or Management Studio (SQL 2005) then selecting all tasks and then Attach Database.

When you do this you will get an error about the log file missing. This shouldn’t matter as SQL Server will simply create a new log file for you.

This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database.
Download help tool for sql database - SQL Server Restore Toolbox.
http://www.sqlserver.restoretools.com/
You can read up more on SQL Server here.
http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/498-creating-a-new-database-using-an-mdf-file?_=1416149856104

Collapse -

An MDF file isn’t a backup file isn’t the main data file

by jackoboyle51 In reply to How do I creating a new d ...

An MDF file isn’t a backup file isn’t the main data file (or master data file depending on who you ask) hence the file extension MDF. You can attach the MDF to the database by right clicking on the databases folder in Enterprise Manager (SQL 2000) or Management Studio (SQL 2005) then selecting all tasks and then Attach Database.

When you do this you will get an error about the log file missing. This shouldn’t matter as SQL Server will simply create a new log file for you.

This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database.
Download help tool for sql database - SQL Server Restore Toolbox.
http://www.sqlserver.restoretools.com/
You can read up more on SQL Server here.
http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/498-creating-a-new-database-using-an-mdf-file?_=1416149856104

Collapse -

An MDF file isn’t a backup file isn’t the main data file

by jackoboyle51 In reply to How do I creating a new d ...

An MDF file isn’t a backup file isn’t the main data file (or master data file depending on who you ask) hence the file extension MDF. You can attach the MDF to the database by right clicking on the databases folder in Enterprise Manager (SQL 2000) or Management Studio (SQL 2005) then selecting all tasks and then Attach Database.

When you do this you will get an error about the log file missing. This shouldn’t matter as SQL Server will simply create a new log file for you.

This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database.
Download help tool for sql database - SQL Server Restore Toolbox.
http://www.sqlserver.restoretools.com/
You can read up more on SQL Server here.
http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/498-creating-a-new-database-using-an-mdf-file?_=1416149856104

Collapse -

An MDF file isn’t a backup file isn’t the main data file

by jackoboyle51 In reply to How do I creating a new d ...

An MDF file isn’t a backup file isn’t the main data file (or master data file depending on who you ask) hence the file extension MDF. You can attach the MDF to the database by right clicking on the databases folder in Enterprise Manager (SQL 2000) or Management Studio (SQL 2005) then selecting all tasks and then Attach Database.

When you do this you will get an error about the log file missing. This shouldn’t matter as SQL Server will simply create a new log file for you.

This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database.
Download help tool for sql database - SQL Server Restore Toolbox.
http://www.sqlserver.restoretools.com/
You can read up more on SQL Server here.
http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/498-creating-a-new-database-using-an-mdf-file?_=1416149856104

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums