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?
If we want to show the structure of a database table or tables in the server then, we will use the SQL command DESCRIBE or other keyword DESC, which is identical to DESCRIBE one.
You can press Ctrl+L after writing the query in the Query window. In the Context Menu of the Query Window, you will find a menu on the toolbar in SQL Server Management Studio with the name “Display Estimated Execution Plan”. It will work the same way as the above step will do.
SQL is a query programming language that manages RDBMS. MySQL is a relational database management system that uses SQL. SQL is primarily used to query and operate database systems. MySQL allows you to handle, store, modify and delete data and store data in an organized way.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With