Reputation: 1984
I have an SQL SERVER database with table, functions, stored procedures. I want to copy this database to the SAME server with a different name.
If the name of my original database is DB_ORIG and I want the copy / clone to a new database called DB_NEW, can you give me the exact commands I would use to copy the database?
Upvotes: 0
Views: 88
Reputation: 51494
There are a number of ways.
The easiest is probably to backup the database, then restore it with the new name.
Make sure there are no views, functions or procedures that refer to the old database explicitly by name.
Upvotes: 3