SQL Example:
DECLARE @TableRowsCount table
(
Tablename varchar(50),
cnt int)
insert into @TableRowsCount
EXEC sp_MSforeachtable @command1=” select ‘?’,count(*) from ?”
select * from @TableRowsCount
PowerShell Example:
Load SQL PowerShell by typing “SQLPS” in PowerShell console
PS:\>SQLPS
Change Directory to the desired database
PS SQLSERVER:\ cd SQL\HQDB001\default\databases\DummyDBName\tables
PS SQLSERVER:\SQL\HQDB001\default\databases\Powersql\tables> dir |format-table Name,Rowcount