http://technet.microsoft.com/en-us/library/ms180765(v=sql.105).aspx
例如tune一个长达2k行的存储过程,就可以使用SET STATISTICS TIME ON。然后查看最耗时的query是哪个。
注意其中几个SET会执行SQL,也就是说是actual plan instead of estimated plan。
http://technet.microsoft.com/en-us/library/ms180765(v=sql.105).aspx
例如tune一个长达2k行的存储过程,就可以使用SET STATISTICS TIME ON。然后查看最耗时的query是哪个。
注意其中几个SET会执行SQL,也就是说是actual plan instead of estimated plan。