Question : Can I create an SQL script to automatically copy a database each night?

So the accounting department has a test database that they use to try out reports before they go live. I'd like to be able to have this test database copy the information from the live database every night automatically.

I know there's a way to generate a script using SQL Server Management Studio, but is there a way to automate the process? Thanks.

Answer : Can I create an SQL script to automatically copy a database each night?

Actually, as you know, this is the way to do the script manually: http://msdn.microsoft.com/en-us/library/ms188664.aspx

Within SQL, it is not possible to automatically run scripts. You would need to alter this in the software or code that is organising the database. I.e. cron jobs on the server or programming to run an SQL command each night to copy the database over to the live version without downtime.

Hope this helps.
Random Solutions  
 
programming4us programming4us