declare @a datetime
select @a = getdate()
select .....  (你的查询语句)
select datediff(ms,@a,getdate())

解决方案 »

  1.   

    怎么用呀我这么用的
    DECLARE @a datetime SELECT    @a = getdate()
    SELECT *                                                                        
     FROM  Forecast_Detail
    SELECT  datediff(ms, @a, getdate())
    弹出一个对话框 1 row affect by last querry
      

  2.   

    declare @a datetime
    select @a = getdate()
    select .....  (你的查询语句)
    select datediff(ms,@a,getdate())
      

  3.   

    DECLARE @a datetime 
    SELECT  @a = getdate()
    SELECT *                                                                        
     FROM  Forecast_Detail
    SELECT  datediff(ms, @a, getdate())/*
      楼主在查询分析器里查看,如在程序里,用变量存起来。
    */
      

  4.   

    declare @a datetime,@b datetime
    select @a = getdate()
    select .....  (你的查询语句)
    select @b=datediff(ms,@a,getdate())
    print @b
      

  5.   

    set statistics time on
    go
    你的查詢語句
    go
    從消息窗體看時間*_*
      

  6.   

    忘了
    set statistics off
    go
      

  7.   

    set statistics time off
      

  8.   

    set statistics time on
    go
    你的查詢語句
    go
    set statistics time off