Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query giving table names

Author  Topic 

zaidiwaqas
Starting Member

8 Posts

Posted - 2009-08-15 : 02:52:18
Hi All,
i would like to know the possibility of getting all the table names where there is any record present.

what i am doing is reverse engineering of an application. i have database on MSSQL 2008.
when i execute some function on this application there is an update on the database. i would like to know the count of all records present in all the table before and after performing the execution.

or because in the start all the tables are having no rows so is that possible to get the list of tables having any records.

i cannot search each table as they are in hundreds.

any help,.
regards
Zd

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-08-17 : 11:36:22
Why not use sql server profiler and see what exactly is being sent and executed?

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-08-17 : 11:57:25
[code]SELECT distinct object_name(object_id) [table], rows FROM sys.partitions[/code]
Go to Top of Page
   

- Advertisement -