chandu1551
4/13/2018 - 6:27 AM

SQL DB Performance Tweaking

SQL DB Performance Tweaking

-------------------------------Rebuild Index of table-----------------------------
1.
USE <<DatabaseName>>;
GO
ALTER INDEX ALL ON DatabaseName.TableName
REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON,
              STATISTICS_NORECOMPUTE = ON);
GO
2.
sp_updatestats

----------------------------Shrink Database-----------------------------------------------------

ALTER DATABASE Insight SET RECOVERY SIMPLE
DBCC SHRINKDATABASE (Insight);
ALTER DATABASE Insight SET RECOVERY FULL