Search code examples
sql-serversql-server-2008-express

How can I clone an SQL Server database on the same server in SQL Server 2008 Express?


I have an MS SQL Server 2008 Express system which contains a database that I would like to 'copy and rename' (for testing purposes) but I am unaware of a simple way to achieve this.

I notice that in the R2 version of SQL Server there is a copy database wizard, but sadly I can't upgrade.

The database in question is around a gig. I attempted to restore a backup of the database I want to copy into a new database, but with no luck.


Solution

  • It turns out that I had attempted to restore from a backup incorrectly.

    Initially I created a new database and then attempted to restore the backup here. What I should have done, and what worked in the end, was to bring up the restore dialog and type the name of the new database in the destination field.

    So, in short, restoring from a backup did the trick.

    Thanks for all the feedback and suggestions guys