Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy database

Status
Not open for further replies.

calvi

Technical User
May 26, 2003
87
0
0
NL
May be a simple question, but because I am quite new to sql server 2008:
How can I copy a database from the same server to another existing database, overwriting all data. I need to do this for several times. so I tried to make a SQL Server Agent job, but I don't really know how to make the action: copy database. With the step name beneath you have to select type and then run as ... Can someone help?
 
Two ways,
detach-copy-attach,
or backup and restore.

Personally I like the backup and restore but I have used both methods.

See BOL.

Good luck,

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
Look in the BOL for directions on Restoring a Database and move files.

You will want to use RESTORE DATABASE with the new database name, then the FROM will be your original database back up. You will have to use WITH MOVE to put the data and log files in the correct locations and name the files properly.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Sorry but what is BOL? where can I find it?
 
Books-On-Line (just pres F1) that is the HELP for SQL Server.

Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top