how to copy database

  • Hi,

    I have database for example x and I need to make a copy of that for example x2 on the same SQL Server. Is it possible to do it with backup and restore or I have to detach make manual copy and attach the new copy with different name. (I've tryed to use DTS but it always says that I don't have some rights so I give up on that)

    Thank you

  • You can backup x and then restore it to x2 using the "With move" syntax to move the files. You can do this using Enterprise Manager, changing the file location found on the "Options" tab. If SQL makes you check "Force Restore over existing database" you have probably messed something up.

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • Yes, you can do this with backup and restore. Backup database_1 then in enterprise manager right click database_2/all tasks/restore.

    In the restore dialog you'll see a drop down with the option to show backups of (or something like that).  Select backups of database_1 and select from the list, the backup you want to use.  On the Options tab you must place a check in the box that allows you to force restore over existing database or you will get a warning that you are trying to restore one database with the backup of another database.  Click OK.

    Of course there must not be any other users or connections to the database you are trying to restore.

     

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

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