Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
asarak
Starting Member
36 Posts |
Posted - 2005-11-14 : 08:55:15
|
I would like to run continously the following statementsBut i don't know how.I try to use goto with waitfor delay but no effect.Any help???loop1:use masterwaitfor delay '000:00:02'select spid,status,loginame,cmd,hostname,cpu,blocked from sysprocesses where blocked>0select count(*) blockings from sysprocesses where blocked>0select count(*) spids from sysprocesses where status like '%run%'goto loop1Regards ASARAK |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-14 : 09:18:59
|
for monitoring use SQL Profiler. It was meant for that.why would you want to this is beyond me...while truebegin --your stuffendGo with the flow & have fun! Else fight the flow |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-14 : 09:21:15
|
orPut that code without loop in sp and insert records to some audit tables; schedulte it and run it as jobMadhivananFailing to plan is Planning to fail |
 |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-11-14 : 09:22:50
|
Spirit1, I think your mixing your languages again while 1=1begin --your stuffendBe One with the OptimizerTG |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-14 : 09:31:32
|
lol Go with the flow & have fun! Else fight the flow |
 |
|
asarak
Starting Member
36 Posts |
Posted - 2005-11-14 : 09:33:26
|
i think that this kind of loop (while) it is running continously but i didnt take any reply until i stop it.I just run it, show the records and run it againand i am going to try madhivanan's solution.... |
 |
|
|
|
|