Restore a database on SQL Server using .mdf, .ldf and .ndf files?

You need to attach the database rather than perform a restore.
Using Enterprise Manager:
Expand the registered SQL server
Right-click Databases, select All Tasks -> Attach Database…
Click the “…” button to browse for the .mdf file
Highlight the necessary .mdf file and click OK
Click OK again
The database will now show up in Enterprise Manager

To use Transact-SQL, use the Query Analyzer tool:
Here is sample command based on your files above. You will need to specify the correct directory where these files exist. The example has the files in the C:\SQL directory.
EXEC sp_attach_db @dbname = N’rs_ds’,
@filename1 = N’C:\SQL\rs_ds_dat1.mdf’,
@filename2 = N’C:\SQL\rs_ds_dat3.ndf’,
@filename3 = N’C:\SQL\rs_ds_dat4.ndf’,
@filename4 = N’C:\SQL\rs_ds_dat2.ldf’

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

After restoring a SQL Server database, it show a status of “Loading”

Getting the database out of LOADING state When restoring multiple backups, each backup needs...

Backing up and restoring a MySQL database from the command line

. Shell into your box as root, then: mysqldump -a -u USERNAME -p DATABASE > FILENAME.mysql...

Change the DNS servers for the network interfaces on my Windows server

In Network Connections, right-click the local area connection, and then click Properties. In...

Change the DNS servers for the network interfaces on Windows server

In Network Connections, right-click the local area connection, and then click Properties. In...

Change the root password for a *nix server

In order to change the root password login to the server as root and type the following, then...