Is there a way to view in real time the query statements the sql server is receiving from my application?
Is there any tool, or a VS debug option I can use to monitor all the queries my C# application is issuing to the SQL Server? I'd like to know how efficient is my C# code and the ORM at building the queries, like how many SELECTs is it sending at a certain time/situation, and based on that be 开发者_如何学Pythonable to issue raw queries if the ORM is producing complex/multiple queries.
Yes. SQL Profiler
SQL Profiler is good for this, however SQL Express doesn't have this. Just FYI.
You can access this from SQL Server Management Studio (IF you use it)
Tools -> SQL Server Profiler
You can also look at the Activity Monitor within Management Studio 2008. Just right-click the main server node and choose "Activity Monitor". This link has information about this tool and also opens with the left-hand nav expanded to show several other topics that may be of interest:
http://msdn.microsoft.com/en-us/library/ms175518.aspx
精彩评论