waitfor的使用

waitfor的使用createtablem test idintidentit 1 1 name int godeclare theCountints theCount 1while theCount100b i 数据库 waitfor 用法

大家好,欢迎来到IT知识分享网。 

create table my_test ( id int identity(1,1), [name] int ) go declare @theCount int set @theCount=1 while @theCount<100 begin insert into my_test values(@theCount) set @theCount=@theCount+1 waitfor delay '00:00:05' end

time 表示到时间以后在执行

而delay  每次执行延迟的时间

同时需要注意的是 执行结果它会在完成整个sql的执行以后才会进行返回。但是sql它已经在后台执行了,你直接是看不到执行状态的,它需要在执行完毕以后才会显示结果。查询sql完全看不到,而操作性的sql可以打开新的新的查询窗口对数据表进行查询就能看到了。

 

 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/156747.html

(0)
上一篇 2025-02-10 15:33
下一篇 2025-02-10 15:45

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信