question

Ty Andreasen avatar image
Ty Andreasen asked

List of tables with column specifying whether they have data

I have a table:

TableName


A
B
C


A,B,C are tables which exist in the database. I want to add a column which does some kind of clevar join which is either 1, or 0, depending on whether the table in the TableName column has data (i.e. at least 1 row). I have tried writing helper functions: special case statements, etc. but have been unable to figure out an elegant way of doing this.

Anybody?

Thank you, Ty Andreasen

dynamic
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Kristen avatar image
Kristen answered

There is a script on SQL Team which will show you the "size" of each table. IIRC it can show size in Bytes, Rows or Percent, so using the Rows option would tell you the number of rows in each table.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.