Size of Exchanged Data With SQL & App RRS feed

  • Question

  • hello

    How can I find/calculate size of exchanged data with my application with SQL Server. I found a poor solution in which you must count each character of each field (after conversion to string) of each record. but as we know, SQL send more data like Relation, Column Name ,... and each data occupy specified size in memory.

    thank you

    • Edited by mmbguide Friday, May 25, 2018 2:55 AM
    Thursday, May 24, 2018 4:30 AM

All replies

  • Hi mmbghide,

    What is  exchanged data? I am not sure what you want to do, can you describe more detailed info about your problem here?

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, May 25, 2018 5:28 AM
  • The quantity of exchanged data in bytes between the SQL server and the VB program is not something you can measure with VB.

    It is something that is done by the Service of SQL, something you cannot reach with VB. 

    If you want to measure this, you need tools made with a lower level program language. You can see something about it if you use SQL profiler.


    Friday, May 25, 2018 7:29 AM
  • Perhaps you want to use the DataLength() function in SQL?  This would let you execute a query that returns the length of each field in bytes.  Instead of selecting the field values directly, you could select the length (in bytes) of each field value, if that is the information you require.  Note that this is not necessarily a character count, as it would depend on the data type of the field being measured.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Friday, May 25, 2018 11:58 AM
  • If you want to query cumulative SQL Server statistics for the provider during the lifetime of the app then this would be supported through the statistics dictionary:

    If you are referring to in-memory storage of SQL Server data then you would probably be looking for a memory profiling tool that could analyze the application during execution.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Friday, May 25, 2018 1:12 PM