RSS

How to Grant Show Plan Privilege

16 Nov
How to Grant Show Plan Privilege

Showplan Privilege it’s granted for any one need to see the execution plane for SQL Server query to check the performance of the index or doing index analysis.

Grant Showplan for one user in one database  :

GRANT Showplan TO [DominName\username]

Grant Showplan for one user in All databases in one SQL instance:

 EXEC sp_MSforeachdb N’IF EXISTS
(
SELECT 1 FROM sys.databases WHERE name = ”?”
AND Is_read_only <> 1
)
BEGIN
print ”Use [?]; GRANT Showplan TO [DominName\username]”
END’;

after the execution take the Print scripts and run it in another session.

 
1 Comment

Posted by on November 16, 2014 in Administration

 

Tags: , ,

One response to “How to Grant Show Plan Privilege

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s