Tag Archives: number of rows in current database

Script to find number of rows in every table

This following script will give you rows count of all table in current databases. Declare c cursor for select ‘['+U.name+'.'+O.Name+']‘ from sysobjects O Inner join sys.schemas U on O.UID=u.Schema_ID where type=’U’ and O.name <>’dtproperties’ Declare @name varchar(255),@sql varchar(100),@id int open c fetch next from c into @name Create table #TSpace(ID int identity(1,1),name varchar(255),rows int,resevered varchar(20),data [...]