How to Calculate the size of sql results in KB?

19 November,2015 by Jack Vamvas

Question: I’d like to understand if there is a way in SQL Server to estimate the size of a sql result set in kilobytes (KB)? Is there some sort of statistic returned which associates a size statistic to a result set?

Answer: The first thing is to consider is that size is not a property of data. This means we need to use various calls to methods which supply the data.

SQL Server Client statistics returns data which will supply you with various details. One of the details it supplies is “Bytes received from server”. To access Client Statistics ,  go to SQL Server Management Studio. And then navigate to : Query | Include Client Statistics.  The next query you execute will include and added tab to the Query results  window.

Client_statistics

A few things to consider when using SQL Server Client Statistics .

1)      The figures represent the workload measured between SSMS and the database engine. If you’re using .Net 4.5   there are function calls which supply various client statistics.

2)      Copying and Pasting to Excel doesn’t include the headers

3)      The Client statistics retains the last 10 executions of a query. You can use this information to track changes made and performance impact

Read More  on SSMS and Query Tuning

Open SSMS without the splash screen - SQL Server DBA

What is SQL Server Query Tuning? - SQL Server DBA

How to fix System.OutOfMemoryException when using SSMS

SQL Server – Find high impact queries with sys.dm_exec_query_stats

 

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to Calculate the size of sql results in KB?


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer