Ash Burlaczenko Ash Burlaczenko - 3 months ago 9
SQL Question

SQL Server equivalent to MySQL's EXPLAIN

I was reading an SQL tutorial which used the keyword EXPLAIN to see how a query is executed. I tried it in SQL Server 2008 with no success.

How do I get the equivalent result?

Answer

I believe that the EXPLAIN keyword is an MySQL concept - the equivalent Microsoft SQL server concept is the execution plan.

The simplest way of getting an execution plan is to turn on the "Show actual execution plan" menu item (in the query menu) in SQL server management studio. Alternatively you can read a more in-depth guide on execution plans here:

This article goes into a lot more detail on what execution plans are, how to obtain an execution plan, and the different execution plan formats.