结果集在查询完成后才返回客户端,但在查询分析器里可以即时看到print的结果

解决方案 »

  1.   

    e.g:
    print getdate()
    waitfor delay '00:00:10'
    print getdate()
    其中的两个日期的显示是过10秒后一起跳出来的,而不是先有第1个,10秒后再有第二个,为什么呢?
      

  2.   

    WAITFOR 语句挂起执行连接,直到发生下列两种情况之一1 已超过指定的时间间隔。
    2 到达一天中指定的时间。
      

  3.   

    to  iwl:
    我不是不知道waitfor的用法,我是想问为什么之前的getdate()没有马上显示出来?
      

  4.   

    sqlserver是面向过程的语言,必须执行上一条语句执行完
    才能执行下一条语句,只有执行到getdate()才能得到
    结果.
      

  5.   

    to 阿来:不是说“sqlserver是面向过程的语言,必须执行上一条语句执行完才能执行下一条语句,只有执行到getdate()才能得到结果.”,问题是为什么开始的getdate()不能马上得到结果呢?
      

  6.   

    批还没结束嘛
    e.g:
    print getdate()
    go
    waitfor delay '00:00:10'
    print getdate()
    go
      

  7.   

    to yitangliang(yitang) :
    请看清楚问题.谢谢!:)
      

  8.   

    select是要等到最后才能显示出来的print可以(查询分析器)
      

  9.   

    to insert2003(高级打字员) 
    print getdate()
    waitfor delay '00:00:10'
    print getdate()
    也是等10秒后才一起出来的.
      

  10.   

    在SQL中,所有的执行语句都放在一下隐性事务中
    ()
      

  11.   

    显示出来的时候是会一起显示的,,但是
    insert into users (username) values('aaa')
    waitfor delay '00:01:10'
    print getdate()
    这样测试时,数据是会马上写进去的,但是显示的结果不会马上出来的