Thursday, February 26, 2009

MSSQL Statistic Update

We had an interesting issue today. We have stored procedure which gets the ids using a CTE and update attributes using the ID. The SP is timing out and when we try to execute the scripts in the sp separately, it worked without timeout issue.

After all the analysis we realized that it may be due to bad statistic issue.

We executed sp_updatestats commend to update statistics. The query worked in no time!

No comments:

Post a Comment

Missing Date

I need to check in a table, is the all day data available, here is the handy script to check the same.. DECLARE @startdate DATETIME ...