Link to home
Start Free TrialLog in
Avatar of apollo-13
apollo-13

asked on

Microsoft SQL server 2008

I have a one database(003) in my microsoft sql 2008 server and i would like to copy all 003 database to my test database(099).

i got backup from 003database.bak ,can i restore it on 099database? how?

Thanks
Avatar of apollo-13
apollo-13

ASKER

SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can you please explain me how under sql server management studio?

I just want to liitle bit test on database 099 but databse 099 is old information, our new database name is 003 and i thought i can take a backup from 003 and restore it on 099 then i have a new information on 099 .

is that correct?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> can you please explain me how under sql server management studio? <<

Vitor has done so.  I will not, simply because it is too error prone.  You will have to fully specify all the file locations and names every time you do a restore.  And you can't be sure after it runs what names you specified at the time you did it.  In my view, therefore, written command should always be used to do these types of restores.  It's your choice, of course, I'm just pointing out what I think will help you avoid problems in the future.

I need to make one adjustment: if the db already exists, you need to add "REPLACE" to the WITH options:

RESTORE DATABASE [099database]
FROM DISK = 'b:\full\path\to\backup\file\033database.bak'
WITH
    REPLACE,
    MOVE '<logical_file_name1>' TO 'd:\full\path\to\data\file\099database.mdf',
    MOVE '<logical_file_name2>' TO 'l:\full\path\to\data\file\099database_log.ldf'
    --MOVE ...
sorry viktor ,i cant exaclty understand ,is there a way with screenshot guiede?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
perfeckt