troubleshooting Question

SHOWPLAN permission denied in database 'AdventureWorks'.

Avatar of enrique_aeo
enrique_aeo asked on
Microsoft SQL Server 2008Microsoft SQL ServerMicrosoft SQL Server 2005
10 Comments2 Solutions1326 ViewsLast Modified:
i "use Windows autentication"

i execute this t-sql
use AdventureWorks
go
grant showplan to [SMI\elopezh]

the message is: Command(s) completed successfully.

i "included actual execution plan"
but i have this error
Msg 262, Level 14, State 4, Line 3
SHOWPLAN permission denied in database 'AdventureWorks'.

the t-sql code this
DECLARE @spexecutesqlStr NVARCHAR(1000) = 'EXEC [dbo].[GetCustomerInformation] @CustomerID = @CustID, @LastName = @Lname'
DECLARE @ParmDefinition NVARCHAR (500) = N'@CustID bigint, @LName varchar(30), @FName varchar(30), @MI char(1), @Email varchar(128), @RegionNo tinyint, @CustomerCode tinyint'
DECLARE @CustomerID BIGINT = 1
DECLARE @LastName VARCHAR(30) = 'Achong'

 EXEC sp_executesql @spexecutesqlStr,
                              @ParmDefinition,
                              @CustID = @CustomerID,
                              @LName = @LastName,
                              @FName = null,
                              @MI = null,
                              @Email =null,
                              @RegionNo = null,
                              @CustomerCode= null
ASKER CERTIFIED SOLUTION
Daniel_PL
DB Expert/Architect
Join our community to see this answer!
Unlock 2 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros