Following is the code to get the table name and row counts
select so.name,si.rows from sysindexes si
inner join sysobjects so
on si.id = so.id
where si.indid=0 and so.type='u'
order by so.name
select so.name,si.rows from sysindexes si
inner join sysobjects so
on si.id = so.id
where si.indid=0 and so.type='u'
order by so.name
USE master
GO
ALTER DATABASE database_name SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE database_name ONLINE
GO