Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Trouble restoring a database to a different server

Author  Topic 

sektor
Starting Member

14 Posts

Posted - 2006-09-26 : 13:06:19
Hello everyone.
Pretty new to SQL Server and i've run into some trouble with something I am attempting to do.

Basically, we imported one of our databases on one of our SQL Servers to a new sql server that we just setup. That went ok with no problems. The DB is now in the new SQL Server.

Now, we need to copy the contents of a second DB from the original server into this new sql server DB. For reference:

We imported a DB Called: siebeldb
We want to import/overwrite another DB into that same DB. We backedup the DB and moved the file to the new SQL server.

So:

Import/Restore: sbprd01(a backup file) into siebeldb

I hope that makes sense.

I have the following command that I am trying to execute in the SQL Query analyzer:


RESTORE DATABASE siebeldb
FROM DISK='C:\Documents and Settings\Administrator\Desktop\siebelprddb092509.bak'
WITH MOVE 'siebelprddb_Data'
TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\siebeldb_Data.mdf',
MOVE 'siebelprddb_Log'
TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\siebeldb_Log.mdf',
REPLACE

It is running right now, but seems to be running into errors. I just added the 'REPLACE' option according to the t-sql reference guide.

Does my script look ok? Am I doing anything wrong?

Thanks,.

Sektor

X002548
Not Just a Number

15586 Posts

Posted - 2006-09-26 : 13:07:30
The errors would help



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

sektor
Starting Member

14 Posts

Posted - 2006-09-26 : 13:17:05
quote:
Originally posted by X002548

The errors would help



Brett

8-)




As soon as they come, i will post.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-26 : 14:08:27
For some examples of "suggested" RESTORE syntax see:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example,Restore

Kristen
Go to Top of Page

sektor
Starting Member

14 Posts

Posted - 2006-09-27 : 11:50:45
Wow. It actually worked with no errors. I think my little script worked.

If that is the case, the only thing I was missing was: REPLACE

THanks
Go to Top of Page
   

- Advertisement -