Skip to content

Instantly share code, notes, and snippets.

SQL PASS PowerShell Virtual Chapter sqlpsvc

Block or report user

Report or block sqlpsvc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sqlpsvc
sqlpsvc / Get-AutoCreateStatsInfo.ps1
Last active Mar 5, 2016
Basics - Monitor SQL Server database Auto Create Statistics
View Get-AutoCreateStatsInfo.ps1
# Code answers from Session Q & A (http://powershell.sqlpass.org/SessionQA.aspx)
[void][Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO")
$sqlservers = "sqlserver2014a","sql2012-esx"
foreach ($sqlserver in $sqlservers) {
Write-Output "Connecting to $sqlserver"
$server = New-Object Microsoft.SqlServer.Management.Smo.Server $sqlserver
foreach ($db in $server.databases) {
if ($db.AutoCreateStatisticsEnabled -eq $false) {
View Help get SQLPS Open Sourced and on GitHub.txt
https://connect.microsoft.com/SQLServer/feedback/details/2442788/open-source-sqlps-and-publish-code-on-github
You can’t perform that action at this time.