Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My old hard disk have a problem that I can't use it now and my database is currently still on it. How can I copy my database by connecting my old hard to my new laptop ?

Like excel that have a file for each database .

share|improve this question

migrated from stackoverflow.com Aug 29 '11 at 7:36

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 2 down vote accepted

You need to locate the various database files on your old hard disc. There will be a minimum of one data file (*.mdf) and one log file (*.ldf). Then copy them over and attach them using SSMS (Right click the "Databases" node in object explorer and choose the "Attach" option in the context menu).

share|improve this answer
    
thanks for the answer martin . but where is the DB files ? Where are they stored Please give me an address like c:/programfiles/... –  Arash Aug 10 '11 at 23:58
1  
Probably `C:\Program Files\Microsoft SQL Server\SomeFolderName\MSSQL\DATA` –  Martin Smith Aug 10 '11 at 23:59
    
i will check it . thanks –  Arash Aug 11 '11 at 0:14
    
just do a search for *.mdf and *.ldf. –  deutschZuid Aug 11 '11 at 3:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.