How can I display the execution plan for a stored

2020-02-07 16:07发布

I am able to view the Estimated Execution Plan (Management Studio 9.0) for a query without a problem but when it comes to stored procedures I do not see an easy way to do this without copying the code from the ALTER screen and pasting it into a query window, otherwise it will show the plan for the ALTER and not the procedure. Even after doing this, any inputs are missing and I would need to DECLARE them as such.

Is there an easier way to do this on stored procedures?

Edit: I just thought of something that might work but I am not sure.

Could I do the estimated execution plan on

exec myStoredProc 234

8条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-02-07 17:10

Running the stored procedure in management studio (or query analyser) with show actual execution plan (from the query menu) enabled will show you the plan for the stored procedure after you have run it. If you cant run it there is show estimated execution plan (though in my experience that is often less accurate.)

查看更多
▲ chillily
3楼-- · 2020-02-07 17:13

Here's a screenshot.Took me a while to figure out where to look for.

enter image description here

查看更多
登录 后发表回答