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 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

Related Articles

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...

Create a backup file of a SQL Server database?

Open Enterprise Manager and expand the registered SQL Server Expand Databases Right-click on...

How to Install MRTG

Solution Steps for MRTG installation are documented as MRTG Installation Make sure MRTG is NOT...

Copy MySQL database to another server through shell?

Copying MySQL Databases to another server If you are using MySQL 3.23 or later, you can copy the...

Installation of Geotrust True Site Icon

Installation of True Site icon: Per the subscriber agreement, you are required to install the...