Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Finding the size of query result

So basically I'm doing a SQL select query, but I want to know how much data I am pulling back (how many kilobytes), any way?

like image 995
Spooks Avatar asked Dec 17 '10 17:12

Spooks


2 Answers

Actually, "Show Client Statistics" within SSMS query Editor Window will return the resultset size, Bytes Received from Server, etc

like image 72
Ta01 Avatar answered Oct 05 '22 17:10

Ta01


SELECT <your query here>
INTO dbo.MyTempTable
FROM <query source>

exec sp_spaceused 'MyTempTable'

DROP TABLE MyTempTable

This wlil Return Rows, Reserved Space, Data space (in KB), Index space, and unused space for that table.

like image 24
JNK Avatar answered Oct 05 '22 16:10

JNK