none
SQL 2008 Express Backup

    Question

  •  

    I have scripted out the backup as you can see below however I cannot figure out how to fire it off automatically. Clearly we would like to have this run in the evening after hours. When I use the 'Task Scheduler' it forces a login and then doesn't automatically run. Is this not possible to automate like the other SQL versions? Or do I need to write something completely different?

     

    BACKUP DATABASE [ChickenOut] TO DISK = N'd:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008EXPRESS\MSSQL\Backup\ChickenOut.bak' WITH NOFORMAT, INIT, NAME = N'ChickenOut-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

    GO

    declare @backupSetId as int

    select @backupSetId = position from msdb..backupset where database_name=N'ChickenOut' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'ChickenOut' )

    if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''ChickenOut'' not found.', 16, 1) end

    RESTORE VERIFYONLY FROM DISK = N'd:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008EXPRESS\MSSQL\Backup\ChickenOut.bak' WITH FILE = @backupSetId, NOUNLOAD, NOREWIND

    GO

     

     

    Thank you!

     

    Chris

    Wednesday, September 24, 2008 1:51 PM

All replies