Hello. I am glad you liked it Unfortunately, when you apply the plan, the current plan for the same query is deleted. Therefore, before applying the plan, you should save old plan for the same query. When you want to revert back, you should apply the old one by removing the applied one. Step 1 Save the old plan before applying the plan Step 2 If you want to revert back, run the below and remove the applied plan: EXEC sp_control_plan_guide N'DROP', N'TestPlanGuide'; Step 3 Apply the old plan in the same way. With high possibility, you can just rerun the query and it will generated the same inefficient plan. But in case, it does not, you can just apply the same saved one
Thanks man. All of your videos are very interesting and useful. I will try this one and let you know if any issue. Thanks Again!
Cool, thanks!
When I see new video I always press like. Always very interesting and usefull.
Your comments and likes give me motivation to continue. Thanks! :)
Hi ,
It's cool video and very useful one.
I have one small doubt. In case if I want to revert back the applied query plan, How we can do it?
Hello. I am glad you liked it
Unfortunately, when you apply the plan, the current plan for the same query is deleted.
Therefore, before applying the plan, you should save old plan for the same query.
When you want to revert back, you should apply the old one by removing the applied one.
Step 1
Save the old plan before applying the plan
Step 2
If you want to revert back, run the below and remove the applied plan:
EXEC sp_control_plan_guide N'DROP', N'TestPlanGuide';
Step 3
Apply the old plan in the same way.
With high possibility, you can just rerun the query and it will generated the same inefficient plan. But in case, it does not, you can just apply the same saved one
This doesn't work if the proc contains more than one statement, which is quite likely
Oh i see. I never tried multi statement batch