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 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente?

Related Articles

Export the data from different tables in our shared SQL environment?

Using Enterprise Manager Expand SQL Server group Expand the server name Expand Databases...

Enable the full text indexing for a MSSQL database

Syntax sp_fulltext_database Initializes full-text indexing or removes all full-text catalogs...

Fix Lame Nameserver Error

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

Connect to my MSSQL database via Enterprise Manager?

To connect to your MSSQL database using Enterprise Manager, please perform the following: 1....

Manage Database Roles

Solution Database roles are conceptually completely separate from operating system users....