Sep 14

NOTE: I am in the process of moving my blog to this new system. Thus, it should be noted that this entry was originally posted on 2/15/08.

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.


leave a reply