April 30, 2014 at 9:23 am
I was wondering if anyone could help me with something that I've noticed now that we've upgraded our SQL version from 2005 to 2012. We have a number of stored procedures that pass in a list of INT IDs from the application and the developers generally call a stored procedure from inside the main stored procedure to put the values in the table. The stored proc is called GetTableIntFromString and does a loop through the string to put it in the table. This doesn't cause any issues in 2005, but when I point SSMS at a SQL 2005 database and run one of these stored procedure that calls this looping stored procedure, I don't get the plan for the nested stored proc call.
When I look at the same query plan pointed at an SQL 2012 database, for the nested proc call, I get the entire plan for the proc call including every time through the loop in the query plan for the main proc. The problem I run into is that this either makes the query plan so big that it errors before I can see the whole plan or at the very least makes for a lot more scrolling while looking at the plan.
Is there any way to make the query plan output from the 2012 database not display the full plan for the nested proc call? If I need to look at how the nested one is performing, it's easy enough to do on it's own, I don't need to see the full thing every time it's used especially since it's making things that I do need to see not appear.
April 30, 2014 at 9:35 am
Have you tried using SQL Sentry Plan Explorer?
It shows plans in a more compact way and can display individual plans in a batch.
EDIT: Oh, last but not least, it's free.
-- Gianluca Sartori
April 30, 2014 at 10:24 am
Instead of trying to capture the plan live, just get it from the plan cache using sys.dm_exec_query_plan. You can combine it with sys.dm_exec_sql_text to identify the specific code you're interested in.
And those plans can also be opened by SQL Sentry Plan Explorer.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 30, 2014 at 12:59 pm
I've been meaning to take a look at SQL Sentry Plan Explorer for a while now. I installed it today and it looks like it solves my biggest problem looking at the query plan for these in SSMS since I can just skip the loop. It'd still be nice to have some way to ignore or group the information from the nested proc, but this fits my immediate need and also looks to have some other time saving features built in.
Thanks for the help!
April 30, 2014 at 2:03 pm
You're welcome.
Don't overlook Grant's advice. It will probably be easier to extract from the cache, even though you won't have all the information stored in the actual plan.
-- Gianluca Sartori
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply