Recent queries for data combinations of LINQ to Object and LINQ to entity require the use of SQL Server Profiler to detect statements executed on the data, which is a great help when debugging SQL statements.
Here is a brief description of the features commonly used in the SQL Server Profiler usage process. (Reprinted from: http://www.cnblogs.com/sdner/p/8043612.html)
Use SQL Server version R2 here
1. When installing the SQL Server database, ensure that SQL Server Profiler is installed, and all installations will be installed automatically by default.
2. Open SQL Server Management Studio, in the menu, locate the "Tools" menu and locate the SQL Server Profiler menu item as shown in.
3. Select "Event Selection" and tick the frequently used items as shown in.
4. Select "Show all Columns", then in the list, tick the "DatabaseName" item.
5. Set the filter, where the settings just filter the database name, because if there is more than one database in a DB instance, then the database name is not filtered, then the execution statements on all the databases can be monitored.
You can also set duration to filter SQL statements for different execution times, such as SQL statements that can be filtered for longer execution times, and select to optimize SQL statements.
What if the same database, multi-person access, only want to detect the statement of their own actions? You can create a database account of your own login (you can delete this user after detection), and then, in the LoginName filter, filter your logged-in database account.
After setting, click "Run" to start monitoring, the monitoring screen is as follows.
For monitoring content, you can save, in the monitoring interface of the "File" menu, select Save As, select the format you want to save, the next time you want to see the data, you can open the saved file directly.
SQL Server Profiler Common features