I am using SQL Server 2008 and would really like to know how the engine executes queries.
Let’s suppose I run this query :
select * from <table1> with(nolock)
or same with a join:
select * from <table1> a with(nolock)
join <table2> b with(nolock) on a.<column1> = b.<column1>
where <some condition>
How does the query work behind the scene?
Is there any way to see actual steps that are performed for execution and showing results?
The database engine analyses the query and selects the best way of retrieving the requested data under the current conditions.
See Displaying Graphical Execution Plans (SQL Server Management Studio).