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 VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
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
SQL 2016 DESIGN & PROGRAMMING
 
 
 
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