I'm trying to run a MS SQL Server backup from the Task Scheduler (Windows Vista, MS SQL Server Express 2005)
If I run the script manually (open the cmd and execute the script) it works. If I add the script to the Task Scheduler, the computer becomes extremely slow, almost freezes, and you have to power it off to make it come back.
This is the t-sql script (as I said, the script works and I used the script generator to create it):
BACKUP DATABASE [MYDB] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\MYDB_junio_2011.bak' WITH RETAINDAYS = 15, NOFORMAT, NOINIT, NAME = N'MYDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'MYDB' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'MYDB' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''MYDB'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\MYDB_junio_2011.bak' WITH FILE = @backupSetId, NOUNLOAD, NOREWIND
GO
This is the batch MyBackup.cmd
sqlcmd -S localhost\ednaapp -U myuser -P mypwd -i c:\scripts\MyDbBackup_2011.sql
So, when I add the batch script MyBackup.cmd to the task scheduler and run the task, the computer freezes.
Any ideas?
Updated Aug-11th Trying to be more specific. The computers get extremely slow, you move the mouse and the pointer moves like 10 seconds later. You press Alt-TAB and the selected windows changes 10 or 15 seconds later. You try to shut down the computer and nothing happens, but not sure if it's trying or not. After 10 or 15 minutes I just press the hardware shutdown button. I don't think is a hardware problem, because the backup works when running manually. Im also redirecting the backup to the local disk. I'm really not expecting a solution but some ideas as where to start. I disabled the AV software, but its Panda and I had some problems with this AV before, so not sure if this is the issue...