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

TSql Script out data

In SQL Server Management Studio (SSMS) you can generate script out the DB Object, you can also generate script for data (Insert statements...