This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
Check Index Fragmentation based on Page Fullness and Fill Factor | |
*************************************************************************** | |
Author: Eitan Blumin | https://www.eitanblumin.com | |
Version History: | |
2020-10-20 Added @MaxDOP parameter, and better comments & indentation | |
2020-01-07 First version | |
Description: | |
This script was inspired by Erik Darling's blog post here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script is used to shrink a database file in | |
increments until it reaches a target free space limit. | |
Run this script in the database with the file to be shrunk. | |
1. Set @DBFileName to the name of database file to shrink. | |
2. Set @TargetFreeMB to the desired file free space in MB after shrink. | |
3. Set @ShrinkIncrementMB to the increment to shrink file by in MB | |
4. Run the script |