如题。
类似于Oracle中PLAN_TABLE的功能。

解决方案 »

  1.   

    定义个变量获取getdate(),运行语句,用datediff获取getdate()和变量的差值
      

  2.   

    set showplan_all on
    go
    --你的语句
    go
    set showplan_all on
      

  3.   

    CTRL+L 获取的是预估的执行计划,有预估的执行时间吗?
      

  4.   

    可以的,首先执行set statistics time on 然后选中目标代码,右击显示估计的执行计划,就会在下面的消息栏里显示各种耗时了。同时显示执行计划(各种开销)
      

  5.   

    看9F的 。补充:
    set showplan_all on
    go
    --你的语句
    go
    set showplan_all off