Discussion in 'SQL Server 2005 General DBA Questions' started by Joben, Jan 7, 2011.
Does any body know the script to list all the tables. I would appreciate your help.
sp_SpaceUsed is used to get the space used by the table
select Count(*) from table will return the number of rows in a table, but it is resource consuming. I generally use
select rows from sysindexes where id = object_Id('table') and indid <2but it may not be accurate all the time. If you need it for all tables, you can try this.
select object_name(id), rows from sysindexes where indid<2 Hope this helps.
Separate names with a comma.