Shrinking database files can be a very resource intensive task when dealing with large files.
Performing a DBCC Shrinkfile in small increments should help. This script will automate this task.
Set your desired target file size and set the increment size for each shrink operation.
Change the increment size accordingly based on your database environment. Start with a small
increment size of 128MB and see how it goes.
Performing a Shrink operation should only be done when absolutely necessary as this can cause disk fragmentation at the file system level.
Note...remember to remove the < > characters form the first 3 SET statements in the script.
P.S.....I'm a somewhat of a newbie at programming and therefor like to keep my scripts simple. Any and all suggestions to improve this script are welcome.