During one of my recent training class when I asked students to check the execution plan using (can be enabled using CTRL+M), they received error as follows.
SHOWPLAN permission denied in database ‘AdventureWorks’.
This is quite common now that all the developers have admin rights. It was very easy to fix this issue.
USE AdventureWorks GO GRANT SHOWPLAN TO UserName GO
Just run above statement in the database where the user is getting an error and he will be able to see the query execution plan without any issue.
It is very critical to see the plan for any query as with the help of the query plan, we can figure out what is happening under the hood for any query. An estimated execution plan is a SQL Server query plan that is generated without actually running the query plan is created for. It is useful for analyzing how a query would behave, without actually running it. The graphical execution plan a tool that presents in images and text, the process by which SQL Server steps through the query.
Let me know what you think of this blog post.
Reference: Pinal Dave (https://blog.sqlauthority.com),