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’

  • Email, SSL
  • 0 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Related Articles

Install and configure DNS server in Windows Server 2003

Solution Install DNS 1. Open Windows Components Wizard. To do so, use the following...

MySQL will not start, “MySQL File ‘/usr/share/mysql/charsets/?.conf’ not found” in error log.

The most common cause for this error, is a failed downgrade of MySQL from 4.1 to 4.0.  Many...

ColdFusion DSN parameters are not updated

SYMPTOMS New CF DSN records are created.  Even the set of parameters is tried to be updated...

Manage Tablespaces

Tablespaces in PostgreSQL allow database administrators to define locations in the file system...

Fix Lame Nameserver Error

A lame server, is one that is specifed at the registrar to be authoritative for a domain, but...