Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...

share|improve this question
    
Be more specific when you say "the computer freezes". If you're talking about the mouse pointer not moving then you're probably talking about a hardware problem. More detail will be necessary to make any kind of diagnosis. –  Evan Anderson Aug 11 '11 at 4:00
    
How much memory do you have in your Vista machine? I ask because Vista is a client OS and is optimized to run user programs (as opposed to services) with the highest priority. when you hand the script over to the task scheduler however it becomes a service. That is where I would start. –  TopHat Aug 16 '11 at 5:40
    
not sure, its a client's computer, I'll check that. Thanks –  Alejandro Angelico Aug 17 '11 at 19:06
    
Did you ever resolve this? I'm having a similar issue with mysqldump –  Mr T May 19 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.