O'Reilly logo

PowerShell Deep Dives by Edited by Jeffery Hicks, Richard Siddaway, Oisín Grehan, and Aleksandar Nikoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 25. Inventory database table statistics using PowerShell and SQL Server Management Objects

Robert C. Cain

SQL Server Management Objects, or SMO, were the only way to interact with SQL Server in the PowerShell v1 days. Although the release of the SQL Provider simplified interacting with SQL Server from PowerShell, there are still many reasons to understand and use SMO with PowerShell. Performance increases, finely tuned control, and access to a large base of existing code samples are but a few of the benefits to understanding and using SMO.

In this chapter you’ll create a script to inventory all of the databases on an instance of a SQL Server. The script will query the databases to get statistics for each table in each database—things ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required