Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created March 15, 2018 22:23
Embed
What would you like to do?
Script to show how to get a row count for tables in a SQL Server database.
$DatabaseParam = @{
SqlInstance = 'localhost\SQLDEV2K14'
Database = 'DMODisabled'
}
Get-DbaDatabase @DatabaseParam |
Select-Object -ExpandProperty Tables |
ForEach-Object -Process {
[PSCustomObject]@{
Name = $_.Name
RowCount = $_.RowCount
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment