如果我想查看 一条select 语句的性能要如何做呢像是 sp_help 我可以查看表的一些信息这方面常用的一些操作  麻烦大家都给多说一些一起学习谢谢

解决方案 »

  1.   

    就是看执行时间了,数据量很大的时候 执行的挺快的性能就好啊下面是查看脚本的开销和执行计划、执行时间
    set statistics profile on 
    set statistics io on 
    set statistics time on 
    go
    /*--你的sql脚本开始*/go 
    /*--你的sql脚本结束*/
    set statistics profile off 
    set statistics io off 
    set statistics time offdeclare @d datetime
    set @d=getdate()
    /*你的sql脚本开始*//*你的sql脚本结束*/
    select [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate()) 
      

  2.   

    要查看性能,可以查看sql的执行计划运行前 ctrl+L