Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

New Script: Getting Table Statistics Using Powershell

$
0
0

Having up to date table statistics are part and parcel of good SQL Server performance. I've posted a Powershell script to easily get statistics from all tables in a target database. While this can and most often is done using T-SQL scripts, I wanted to demonstrate the basics of how to dig into Powershell's SqlServer module as an alternative for PS pros and enthusiasts.

The script is kept relatively simple, outputting the results as a System.PSObject which can be piped to other cmdlets for further processing in keeping with the overall Powershell paradigm. Use the Get-Help cmdlet to view the documentation.

The script is located here. For this or any script from the Scripts Center, use the "Get the Code" button to download it so the author receives points.


Viewing all articles
Browse latest Browse all 4871

Trending Articles