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?
Actually, "Show Client Statistics" within SSMS query Editor Window will return the resultset size, Bytes Received from Server, etc
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.
You can include the actual execution plan of the query in the Results window of SSMS, which will display an estimated row size for the results. Multiply that by the number of rows to get your result. Not sure how accurate the estimated row size is, though.
You can use sp_spaceused to get the size of a table. But I am unaware of any way to get the size of a query (of course that means little).
One way to get a quick estimate of the size would be to save the data as a text file. Obviously, there will be extra whitespace. But it would give you a general idea on how large the query is.
精彩评论