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

Managing SQL Role

Recently, we had a scenario, where we need a simple SQL Role which gets read access to bunch of views.  While it was easy to create the vie...