dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaDbCompression

This function gets the current size and compression for all objects in the specified database(s), if no database is specified it will return all objects in all user databases.

Screenshots

dbatools-Get-DbaDbCompression

Examples

Returns objects size and current compression level for all user databases.

Get-DbaDbCompression -SqlInstance localhost

Returns objects size and current compression level for objects within the TestDatabase database.

Get-DbaDbCompression -SqlInstance localhost -Database TestDatabase

Returns objects size and current compression level for objects in all databases except the TestDatabase database.

Get-DbaDbCompression -SqlInstance localhost -ExcludeDatabase TestDatabases

Author

This command was created by Jess Pomfret. You can find Jess on Twitter.

Get-Help

From PowerShell, execute Get-Help Get-DbaDbCompression -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaDbCompression.ps1 on GitHub
 

Related commands