Having found this invaluable source of people who actually answer questions, I thought I would make the most of it and ask something that has been bugging me for a while:
Is there an equivalent of the MS SQL Server profiler, or some behind the scenes method which can allow me to view what SQL statements are being executed on a particular connection?
The reason I ask is because I would like to explore the (in)efficiency of various Entity Framework queries from code, which it is impossible to view otherwise, and to see quite how awful the SQL statements generated are in the case of complex relationships and Include statements.
asked 26 Nov '10, 18:02
I am sure there are many different answers to your question; but if all you want to do is view the SQL being executed on the server without any real analysis, then I would suggest using the request level logging feature built into SA. Have a look at the request logging section in the documentation.
If, however, you want to perform some advanced analysis (ex. application profiling), then there are other tools within SA that you can use. See the section on monitoring and improving database performance within the documentation.
answered 26 Nov '10, 18:56