locked
How to know the data size of my select query RRS feed

  • Question

  • please tell me how could i determine the size of my select query return result set. suppose i issue a sql query like

    select id, name, salary from EMP and result will be return and how could i measure that data size of return resultset.

    thanks

    Wednesday, February 22, 2017 9:18 AM

Answers

  • Hi ,

    In the next link you can have the total bytes recieved, or measure your actual result set size .

    http://stackoverflow.com/questions/4473023/sql-finding-the-size-of-query-result


    Regards, David .

    • Marked as answer by Sudip_inn Wednesday, February 22, 2017 9:37 AM
    Wednesday, February 22, 2017 9:24 AM

All replies

  • Export result to the text file and see its size

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Wednesday, February 22, 2017 9:23 AM
    Answerer
  • Hi ,

    In the next link you can have the total bytes recieved, or measure your actual result set size .

    http://stackoverflow.com/questions/4473023/sql-finding-the-size-of-query-result


    Regards, David .

    • Marked as answer by Sudip_inn Wednesday, February 22, 2017 9:37 AM
    Wednesday, February 22, 2017 9:24 AM
  • you can insert the result into a middle table after querying, then you can get the size from  object explorer.



    • Edited by 亻亻亻 Wednesday, February 22, 2017 9:37 AM ss
    Wednesday, February 22, 2017 9:32 AM
  • the link is nice help found good 2 tips

    Tips 1
    --------
    Actually, "Show Client Statistics" within SSMS query Editor Window will return the resultset size, Bytes Received from Server, etc
    
    Tips 2
    --------
    SELECT <your query here>
    INTO dbo.MyTempTable
    FROM <query source>
    
    exec sp_spaceused 'MyTempTable'
    
    DROP TABLE MyTempTable

    Wednesday, February 22, 2017 9:37 AM