Apply the execution plan from one server to another in SQL Server

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии • 8

  • @LordKazekaage
    @LordKazekaage 7 месяцев назад +1

    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!

  • @maksimbondarenko1179
    @maksimbondarenko1179 7 месяцев назад

    When I see new video I always press like. Always very interesting and usefull.

    • @arslanov1886
      @arslanov1886  7 месяцев назад +1

      Your comments and likes give me motivation to continue. Thanks! :)

  • @jeroldantony639
    @jeroldantony639 6 месяцев назад +1

    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?

    • @arslanov1886
      @arslanov1886  6 месяцев назад

      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

  • @worldfromtheair
    @worldfromtheair 6 месяцев назад +1

    This doesn't work if the proc contains more than one statement, which is quite likely

    • @arslanov1886
      @arslanov1886  5 месяцев назад

      Oh i see. I never tried multi statement batch