Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Problem with a stored proc

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2010-06-15 : 16:17:05
I ahve a stored procedure that runs a pretty basic query. I run the query and it runs fine. I run the proc and 20 minutes later its still running. I dont know where to begin to diagnose it.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-15 : 16:22:39
Sounds like parameter sniffing to me. You should read up on this subject as it's a problem in SQL Server.

Could you compare the execution plans? Check the plan when you run the query and also check the plan when you run the stored procedure. If possible, post the plans here.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -