Restoring a SQL Server Database by Attaching

I recently needed a copy of a SQL Server database from a co-worker's machine. Instead of trying to use the restore option in SQL Server, I just simply copied the .mdf and .ldf files for that database from SQL Server directories (usually, C:\Program Files\Microsoft SQL Server\MSSQL.[dbnumber]\MSSQL\data), and pasted them into my SQL Server directories. I then right clicked on "Databases" and selected "Attach". Browse to the new files, and it adds the database to the list.

Very easy.

Comments
Contact Chris SchofieldBlogCFC was created by Raymond Camden. This blog is running version 5.9.001.