This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
The Shrink method attempts to reduce the size of a referenced operating system file, or attempts to reduce the size of all operating system files maintaining the referenced Microsoft SQL Server database.
For the Database object, the NewSize argument is set using any negative number or a number from 1 through 100. When negative, the Shrink method to attempts to shrink files maintaining the database to their smallest possible sizes. A positive value represents a percentage of the target reserved as unused space. For example, specify 5 to shrink a database leaving five percent free space for future growth.
For the DBFile and LogFile objects, the NewSize argument is set using any negative number, zero, or any positive integer. When negative, the Shrink method attempts to shrink the referenced file to its smallest possible size. Zero or a positive value represents a target file size as a number of megabytes.
Set the Truncate argument using these values.