DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
SITE SEARCH SQLUSA.com HEADLINES NEWS
SQL E/BOOKS   SQL 2014 PROGRAMMING   DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
How to INDEXDEFRAG during daytime?

If DBCC INDEXDEFRAG to defragment fragmented indexes takes over an hour, it is best not to do it. Since it is a logged operation, it puts lots of overhead on SQL Server's operation. If it takes only 5 minutes, then it should be done for key indexes. Microsoft SQL Server 2008 T-SQL syntax:

-- DBCC index defragmentation

DBCC INDEXDEFRAG (AdventureWorks2008, "Production.Product", PK_Product_ProductID)

GO

/*

Pages Scanned     Pages Moved Pages Removed

13                0           0

*/

 

Exam Prep 70-461
Exam 70-461
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE