Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Is there any possible ways in sql server to find out how many bytes/KBs for a single select statement?
Posted

I am not sure how you will get it in bytes. But to know the performance eficiency of a query you can use sql server profiler.

To know which queries causes too much traffic
follow ths link,
http://dba.stackexchange.com/questions/756/find-out-what-queries-are-causing-the-biggest-amount-of-network-traffic[^]

To monitor network performance, follow this link

http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/68e33a4b-1b70-4f22-8531-6b86d834ac65/[^]

Another way of calculating the size of data you querying is insert into table and use the sp_spaceused.

For eg.If i have a query
SQL
SELECT * FROM employee where YEAR(InsertDate)=2012

I want to know how much data its going to fetch.
For taht i am going to insert these into temp table and use sp_spaceused.

SQL
SELECT *
INTO dbo.temptable
FROM employee where YEAR(InsertDate)=2012

exec sp_spaceused temptable

DROP TABLE temptable
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900