Friday, March 9, 2012

Schedule SQL Express back up from ASP Page

Hello,

I need to schedule SQL Express backup from ASP Page. I was trying to use SQLDMO to schedule jobs but found that SQL Agent is not supported in Sql Express. I tried to use Scheduler.SchedulingAgent.1 to add task in schedular but getting Invalid class string error. Schedular dll is only supported in site server. What would be the best solution for me to schedule back for SQL Express?

hi,

as you already noticed, SQLExpress does not provide the native SQL Server Agent to support scheduled jobs like backups..

you have then to rely on third party scheduler, like http://www.valesoftware.com/products-express-agent.php, http://www.codeproject.com/useritems/SQLAgent.asp (free code)

personally I do recommend relying on the native OS scheduler (AT/SCHTASK) where you can define your standard schedules to execute cmd file including SQLCmd.exe calls, like
[cmd file]
SQLCmd -E -S(Local) -Q"BACKUP DATABASE [Pubs] TO DISK = N'D:\folder\Pubs.bak' WITH FORMAT, INIT, NAME = N'Pubs-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" >>d:\folder\BckOutput.txt
[/cmd file]

which backups the Pubs database to the d:\folder\Pubs.bak file, outputting the backup execution to a text file, d:\folder\BckOutput.txt, you can later inspect for results...

additional info about this can be found at http://www.sqldbatips.com/showarticle.asp?ID=27 and http://www.sqldbatips.com/showarticle.asp?ID=29, where another free tool by an MVP fellow, Jasper Smith, is available for download to help performing backup tasks..

regards

No comments:

Post a Comment