You are here: Slow stored procedures « MsSQL Server « IT news, forums, messages
Slow stored procedures

Posted by Cory on 09/06/05 19:17

Hi,

I have a stored procedure that normalizes data from one database to
another that is included in a SQL Agent job. The job is started by a
trigger so that when a table is updated, the job to normalize data
executes.

This happens once a day in the dead of the night when nothing else is
happening and the stored procedure takes 2.5 hours to finish. Strangely,
to run the same stored procedure from Query Analyzer takes only 20
minutes to do the same thing. The job is executed as the same user that
logs in to Query Analyzer.

Why does running as a job take so much longer than running it manually.
At the time the job is run, there is absolutely nothing else to create
waits or deadlocks. A profiler trace shows that each statement runs
quickly but then it sits and twiddles its thumbs between statements.
Performance monitor shows little disk activity and only 2% to 5%
processor utilization.

Any ideas?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация