none
SQL Server 2000 - Restore command specifying the location for mdf and ldf files?

    Question

  • Hi, I have an old server with SQL Server 2000.

    I have a "c:\db1.bak"
     which needs to be restored in such a way that mdf and ldf files are saved in "X:/Data"

    If someone can please post the command that will be great!

    Thanks so much.

    Friday, July 26, 2013 4:16 AM

Answers

  • TRY,

    RESTORE DATABASE DB2
    FROM DISK = 'C:\DB1.bak'
    WITH MOVE 'DB1_Data_logicalName' TO 'X:\DATE\DB2_DATA.mdf',
    MOVE 'DB1_log_logicalName' TO 'X:\DATA\DB2_LOG.ldf',REPLACE


    Regards, RSingh


    • Edited by Ch. Rajen Singh Friday, July 26, 2013 4:32 AM TXT CHANGE
    • Proposed as answer by Satheesh Variath Friday, July 26, 2013 5:27 AM
    • Marked as answer by ran009 Friday, July 26, 2013 6:02 AM
    Friday, July 26, 2013 4:31 AM

All replies

  • http://msdn.microsoft.com/en-us/library/ms190447%28v=sql.105%29.aspx

    http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/


    Srinivasan

    Friday, July 26, 2013 4:21 AM
  • TRY,

    RESTORE DATABASE DB2
    FROM DISK = 'C:\DB1.bak'
    WITH MOVE 'DB1_Data_logicalName' TO 'X:\DATE\DB2_DATA.mdf',
    MOVE 'DB1_log_logicalName' TO 'X:\DATA\DB2_LOG.ldf',REPLACE


    Regards, RSingh


    • Edited by Ch. Rajen Singh Friday, July 26, 2013 4:32 AM TXT CHANGE
    • Proposed as answer by Satheesh Variath Friday, July 26, 2013 5:27 AM
    • Marked as answer by ran009 Friday, July 26, 2013 6:02 AM
    Friday, July 26, 2013 4:31 AM