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
 VBscript to trigger a SQL back up?

Author  Topic 

doctortt
Starting Member

8 Posts

Posted - 2007-08-14 : 13:34:34
Hi guys. I'm now stuck with something and wondering if anyone can shed me some lights.
I'm now building a backup procedure for an application (business objects), and the sequence is
1) stop the service of the application
2) SQL backs up the database and at the same time, copy a folder to a backup location
3) restart the service of the application

I've come up with the scripts to stop/start the service and copy the folder to a backup location. Now, my boss wants me to put everything into a single procedure, but I have no clue how. My question is how do I trigger a SQL backup after the script stops the service of the application?

pootle_flump

1064 Posts

Posted - 2007-08-14 : 14:34:26
One question - why stop the service? You know that backups are an online function right?
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-08-14 : 14:36:21
BTW - the syntax to get SQL Server to backup using T-SQL is in Books Online under "backup database statement". This will be able to do everything and more that you are used to doing with the GUI.
Go to Top of Page

doctortt
Starting Member

8 Posts

Posted - 2007-08-14 : 14:49:06
Thanks for the replies. Unfortunately, it's recommended to stop the service by the vendor. I'll look up backup database statement.
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-08-14 : 17:10:37
Are you stopping the SQL Service or your front end application?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-14 : 21:42:45
And you can't do sql db backup if sql is not running.
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-08-15 : 03:26:37
quote:
Originally posted by rmiao

And you can't do sql db backup if sql is not running.

Heh - pre-empted me. I'm hoped the OP isn't backing up the filesystem...
Go to Top of Page

doctortt
Starting Member

8 Posts

Posted - 2007-08-15 : 12:28:35
I'm stopping the service of the front end application.
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-08-15 : 18:02:29
quote:
Originally posted by doctortt

I'm stopping the service of the front end application.

Ok - you need to take the vendors recommendation although it sounds a little extreme IMHO, or at least belt and braces. SQL Server can handle backups during transactions.

Anyway - the advice re T-SQL stands. You should be able to open a connection and execute the backup command through that.
Go to Top of Page
   

- Advertisement -