Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

T-SQL: Determine space used in part of a table

$
0
0

Finding out how much space is used by a SQL table is pretty easy.  I've been using a script I found back in ~2008.

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

I was amazed to see that the article still comes up at the top of the list when I google for the latest and greatest "how-to" on the subject.  

Anyway, the way the script works doesn't look like it can be changed to work on just part of the table.  

For instance, I've got a table, let's call it, Error_log.  There's errors in there going back to 2015.  I want to see how much of that table's 9Gb of space used is in the rows where the err_log_add_date is before 1/1/2017.  Is there a simple way of doing that?


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>