Ever wonder when you fire any of SQL statement, how SQL server process them, and fires in db ? Here is some of them which I got just
Processing order of a SELECT statement.
- GROUP BY
- ORDER BY
When Insert Statements are fired.
- IDENTITY Insert check
- Not Null Constraint Validation.
- Data Type Verification
- Instead of trigger execution If it exists.
- Primary key Constraint Validation
- Check Constraint Validation
- Foreign Key Constraint Validation
- After Trigger Execution
Good way to know this is just write this when executing your query :
SET STATISTICS PROFILE ON
<< your sql statement >>>
SET STATISTICS PROFILE OFF
Few other options like this are which are mostly used for performance enhancements are
SET STATISTICS IO ON
SET STATISTICS TIME ON
SET STATISTICS XML ON