Geeks With Blogs
Nagendra Prasad

Basically, we need two files to restore the database. They are .mdf and .ldf files. There is another way to restore the database, if we have the database backup file(.bak). But we can restore using one file(.mdf file) as well. Here's how it will be restored using .mdf file.

 

-- Restore Database using MDF File alone
EXEC sp_attach_single_file_db @dbname = 'testerDB',
@physname = 'c:\testDB.mdf'

Hope this might help.

Posted on Friday, August 21, 2009 1:06 PM | Back to top


Comments on this post: Restore DB with mdf file alone - SQL Server

# re: Restore DB with mdf file alone - SQL Server
Requesting Gravatar...
Thanks so much, this worked perfectly and I didn't have to ask the client to send the .ldf.
Left by Jean Johnson on Jun 09, 2010 11:46 AM

Your comment:
 (will show your gravatar)
 


Copyright © nagendraprasad | Powered by: GeeksWithBlogs.net | Join free