Gossamer Forum
Home : General : Databases and SQL :

SQL scheduled job takes hours to run, Query analyser takes 3 mins to run same script

Quote Reply
SQL scheduled job takes hours to run, Query analyser takes 3 mins to run same script
SmileHello out there, has anyone got any ideas on why a script which runs in query analyser in 3 minutes takes 7 hours 28 minutes when scheduled as a job? dedicated SQL 2003 Server, not other backups or jobs running.



Appreciate any advice!!
Quote Reply
Re: [collette] SQL scheduled job takes hours to run, Query analyser takes 3 mins to run same script In reply to
Depending on the STEPS you have in the scheduled task, and also the settings in the SQL Server Agent (like timeout settings, don't know where they are located in SQL Server 2003), it may take longer to run than in query analyzer.

I'd double check your STEPS and make sure that the SQL Statements used in thos STEPS are optimized.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [collette] SQL scheduled job takes hours to run, Query analyser takes 3 mins to run same script In reply to
Perhaps query analyzer is just analyzing the query and not fetching the result set? Otherwise, perhaps your script is doing something else that takes that long, try running the script manually and see what it is doing.

Cheers,

Alex
--
Gossamer Threads Inc.