SQL SERVER – Fix: Error: 262 : SHOWPLAN permission denied in database

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.

SQL SERVER - Fix: Error: 262 : SHOWPLAN permission denied in database execution-plan Msg 262, Level 14, State 4, Line 1
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.

Fix Workaround:

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),

Execution Plan, SQL Error Messages, SQL Scripts, SQL Server, SQL Server Security
Previous Post
SQL SERVER – Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON
Next Post
SQL SERVER – SQL Server RDL Specification

Related Posts

Leave a Reply