When programming with EF, sometimes we can't look at the SQL statements that EF eventually generates, and it doesn't parse the problem well. Let me explain the use of SQL Server Profiler. SQL Server Profiler can view the resulting SQL statements.
First open Microsoft SQL server Management Studio, and then open the Tool->sql Server Profiler,
If the application is more, the interface may be full at once, it is not good to find the corresponding SQL, you can follow the following steps to do:
1. First run the program to the previous step of the database operation.
2. Clear the contents of the interface.
3, continue to run the source code, until the database related operations to execute the source code.
4. Pause the operation of ' SQL Server Profiler '.
5, Ctrl+f, enter the name of the table you want to find, the name of the stored procedure, and so on.
Select the row, and at the bottom you will see the generated SQL statement.
The SQL Server Profiler tool is a great place to debug SQL for our development environment.
Using SQL Server Profiler skillfully