12

If I select the "Include execution plan" checkbox in the Data Explorer, the query fails:

SHOWPLAN permission denied in database 'StackOverflow'.

I see that this has happened before following maintenance. I don't know whether there was any recent maintenance. It's been several days since the data was updated and longer since an update was deployed, if that's related.

  • 1
    There was a security incident reported earlier, maybe this has something to do with that..meta.stackexchange.com/questions/260416/… – rene Jul 11 '15 at 21:08
  • I'm now getting the error The 'CardinalityEstimationModelVersion' attribute is not declared. if I try to get the query plan against a real table. Different error, but same net result, so I won't open a new question. – Jeremy Aug 26 '15 at 3:46
  • I have a submitted a PR to get that fixed. – rene Aug 29 '15 at 7:57
5

It is annoying but at least the showplan permission has been fixed somewhat by not using the checkbox on the UI but leveraging the SHOWPLAN_TEXT setting yourself as part of the command batch:

SQL

set showplan_text  on
go 
select top 10 *
from posts 
inner join votes v on v.postid = posts.id
go

Result

StmtText                                                             
-------------------------------------------------------------------- 
select top 10 *
from posts inner join
votes v on v.postid = posts.id 

(1 row(s) returned)

StmtText                                                                                                                                                                                                     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  |--Top(TOP EXPRESSION:((10)))                                                                                                                                                                              
       |--Nested Loops(Inner Join, OUTER REFERENCES:([v].[PostId], [Expr1003]) OPTIMIZED WITH UNORDERED PREFETCH)                                                                                            
            |--Clustered Index Scan(OBJECT:([StackOverflow].[dbo].[Votes].[UIX_Votes_Id] AS [v]))                                                                                                            
            |--Clustered Index Seek(OBJECT:([StackOverflow].[dbo].[Posts].[UIX_Posts_Id]), SEEK:([StackOverflow].[dbo].[Posts].[Id]=[StackOverflow].[dbo].[Votes].[PostId] as [v].[PostId]) ORDERED FORWARD) 

(4 row(s) returned)

I tried this same script earlier (when I left the comment) and at that time this failed as well.

So consider this now as a temporary workaround.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .