Saturday, February 25, 2012

Query Time in SQL Server

I am using SQL Server and ASP.NET. I am executing a couple of stored procedures and displaying the results in a datagrid. Since these Stored procedures takes around 2-4 minutes each, I want to display a status bar on the web by displaying the approximate time the user needs to wait before seeing the results.

My question is: Is there a way to find out the approximate EXECUTION TIME of the stored procedure before hand. Also, if that is possible, how do i access the same from the ASP.NET code..

Thanks
SathyaI do not know of a way to determine the approximate execution time of a stored procedure before it runs.

Perhaps you should use the worst-case execution time as your estimate for each?

And also, 2-4 minutes for a query to run is not reasonable. You should strongly consider spending some time trying to optimize these queries.

Terri|||I agree with Terri on this one. 2-4 minutes for a query to run especially as a stored procedure is saying a tremendous amount to the inefficiencies you may have in your design or execution.

Initially, I'd take the time to repair that before continuing further to make your future tasks with your application even more complicated.

No comments:

Post a Comment