Trying a DB RESTORE

  • Trying to restore a db to my local machine from development server. So, I created the db locally and downloaded the bak file and then generated the sql script for the restore.

    RESTORE DATABASE [DEV_Version8_ReleaseV8_5_Maintenance] FROM

    DISK = N'C:\Documents and Settings\Eddy\My Documents\Downloads\8.5_Maintenance\8.5_Maintenance.bak' WITH MOVE N'InterlinkOne_Data'

    TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\DEV_Version8_ReleaseV8_5_Maintenance.mdf',

    MOVE N'InterlinkOne_Data02'

    TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\DEV_Version8_ReleaseV8_5_Maintenance.mdf',

    MOVE N'InterlinkOne_Log'

    TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\DEV_Version8_ReleaseV8_5_Maintenance.ldf',

    NOUNLOAD, STATS = 10

    GO

    but when I try running this I get;

    File 'C:\Program Files\Microsoft SQL Server\MSSQL\data\DEV_Version8_ReleaseV8_5_Maintenance.mdf' is claimed by 'InterlinkOne_Data02'(3) and 'InterlinkOne_Data'(1). The WITH MOVE clause can be used to relocate one or more files.

    Msg 3013, Level 16, State 1, Line 2

    RESTORE DATABASE is terminating abnormally.

    Any help would be appreciated, thanks.

  • You're specifying the same file (the .mdf) for two data files. Each file needs a different file name.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • aah thanks, that did the trick.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply