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
 General SQL Server Forums
 New to SQL Server Programming
 check table size

Author  Topic 

daniel50096230
Yak Posting Veteran

99 Posts

Posted - 2010-07-30 : 09:28:07
Hi,

I have a table called trn_po and I would like to count the table size based on some criteria.

For example, my select statement is "SELECT * FROM Trn_PO Where PONo='1111'"...Then I would like to count the size of the data that retrieve from the select statement.

Can anyone advice?

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-30 : 09:32:31
do you mean what the data size of the returnwed rows would be if you saved it to a file?

Post the DDL of the table



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-07-30 : 11:32:33
Not sure I get exactly what you want to do, but you can look at BOL (Books Online) and get the size in bytes for each type (for example, INTEGER takes 4 Bytes). So you can calculate the size of a row then multiply that by the COUNT of rows your query would return.
Go to Top of Page
   

- Advertisement -