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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 back up and restore

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-11-10 : 08:44:25
i want to backup my DB in production server and restore it in development server

how can i do it in daily?

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-11-10 : 09:12:39
Hi,

Have a look at:
http://www.sqlservercentral.com/articles/Backup+%2F+Restore/71272/

Regards,
Bohra

I am here to learn from Masters and help new bees in learning.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-11-11 : 05:37:58
i have 2 servers:

DevServer -DevelopmentServer
ProdServer - ProductionServer


RESTORE DATABASE DevServer.[DBTest] FROM DISK = N'\\store\DBTest.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10

i get this error:
"Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon."

how can i run this on ProdServer (In job)?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-11-11 : 09:55:48
RESTORE DATABASE DevServer.[DBTest] FROM DISK = N'\\store\DBTest.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-11-11 : 11:30:43
You can't run the restore from the production server, it has to be run from dev. Set up a job on the dev server that copies the backup over (if necessary) then restores it.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-11 : 12:56:55
I've got a blog on this topic: http://weblogs.sqlteam.com/tarad/archive/2009/02/25/How-to-refresh-a-SQL-Server-database-automatically.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -