• hboswell (3/27/2014)


    [Edit: I found the proper procedure and managed to accomplish what I wanted, using the "Restore Files and Filegroups" option, so this comment is now irrelevant]

    Here's a related question: I want to make a copy of my database (database A in the above thread) on my server, to use as a test database. I had read that it could be done by following these steps in Management Studio:

    1) Create a backup of the database you want to copy

    2) In SSMS, right-click 'Databases' and select 'Restore Database'

    3) Select the database you wish to copy from the 'From database' drop-down list in the 'Source for restore' section

    4) Enter the name of the new database in the 'To database' field in the 'Destination for Restore' section - this cannot be the name of an existing database.

    5) Click OK

    But when I do that, I get the following error:

    System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\UMMC.mdf' cannot be overwritten. It is being used by database 'UMMC'. (Microsoft.SqlServer.SmoExtended)

    I'm trying to create UMMCTEST.

    Thanks,

    Harry

    Yeah, probably the data and log path is not the same on both servers. Check the path on target server and restore with the WITH MOVE option, so you can actually refresh and overwrite database "B".