Large set of execution plans hangs up SSMS

Have you looked at SentryOne Plan Explorer? It can handle humongous plans that Management Studio chokes on. You can also generate both actual and estimated plans from within the tool, so you don't even have to bother with SSMS.


Try SET STATISTICS XML ON before you run your query. That will return the plan in XML format without trying to render it in SSMS. You could then copy and paste the text into a file. From there, you'll get the plan in XML format, and you can open it up in a tool like SQL Sentry Plan Explorer.


I've had this happen from time to time. The option to SET STATISTICS XML ON as referenced above is probably the best answer (outside of using a thrid party). However, I've found that running SSMS on the server itself can help. That said, if you are crashing SSMS on your local box, probably not a great idea to try it on the server.

Another thing you can do is query the plan cache to see which execution plan(s) are in cache for that proc with a query similar to this one:

select
querytext.text,executionplan.query_plan , plan_handle
from
sys.dm_exec_cached_plans 
outer apply sys.dm_exec_sql_text(plan_handle) as querytext
outer apply sys.dm_exec_query_plan(plan_handle) as executionplan 
Where text like 'Create procedure dbo.procname%'

Another thing that I always do - even before looking at an execution plan, is SET STATISTICS IO ON and then run the proc / code. If I'm happy with the output of SET STATISTICS IO ON, chances are I have a plan that I'll like. http://msdn.microsoft.com/en-us/library/ms184361.aspx