Gets table names and record counts in each table
BEGIN
select "TABLE NAME"= convert (varchar (50), o.name), "ROWS"=i.rows
from sysobjects o, sysindexes i
where o.type = 'U'
and o.id = i.id
and i.indid in (0,1)
and i.rows>0
-- and i.name like '%mys%'
order by o.name desc
END