3

How can I calculate the size of a T-SQL query in bytes transfered across the network?

I know I can approximate it by examining data types of columns (varchars are an interesting twist though), but are there tools that'll give me the number of bytes (including and excluding TCP/IP headers) used up while transferring the query and its results to and from the SQL Server?

dance2die
  • 35,807
  • 39
  • 131
  • 194
Allain Lalonde
  • 91,574
  • 70
  • 187
  • 238
  • Perhaps use a network listener like [WireShark](http://www.wireshark.org/)? That should give you exact sizes for packets. – Oded Dec 21 '09 at 14:18

1 Answers1

11

If you are using the Microsoft Sql Server Management Studio, you can toggle the "Include Client Statistics" from the "Query" menu.

You will get some network statistics like

  • Bytes sent from client
  • Bytes received from server
  • TDS packets received from server

You can also leave that option on and get an average of all query executions.

Pierre-Alain Vigeant
  • 22,635
  • 8
  • 65
  • 101