Wednesday, October 14, 2009

Speed up the Queries, Reindex the tables

Whenever we get timeout error, we need To Speed up the queries by running the following Queries in Database
1) First Way is
ALTER INDEX ALL ON Tablename REBUILD WITH (FILLFACTOR = 80)
UPDATE STATISTICS Tablename WITH FULLSCAN, NORECOMPUTE
EXEC SP_UPDATESTATS

2) Second Way is
DBCC DBREINDEX (Tablename, '', 90)

2 comments:

Sajith Premachandra said...

Very useful command Bikash. I really appreciate this.

Sajith Premachandran

Anonymous said...

Very nice blog and useful queries

from
Ghanshyam