各テーブルのカウントを出力するSQL文を作成したいのですが、どなたか教えていただけないでしょうか?使用しているDBはSQLServerです。
---作成したSQL文---
declare g_name cursor for
SELECT name FROM sys.objects WHERE type = 'U'
open g_name
fetch next from g_name
while @@FETCH_STATUS = 0
select count(*) from g_name
fetch next from g_name
end loop
close g_name
deallocate g_name