Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error on this code "GO WAITFOR DELAY '00:00:05'"


Error on this code "GO WAITFOR DELAY '00:00:05'"

Author
Message
malik_nagel
malik_nagel
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 32
I want to run a "GO" and then pause for 5 seconds. When I run this code I get "A fatal scripting error occurred.
Incorrect syntax was encountered while parsing GO" Does anyone know why this and how I can run a pause after a GO?
These two statements run fine when they are separate.

Thanks!
Michael Valentine Jones
Michael Valentine Jones
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4808 Visits: 11771
"GO" is not a SQL Statement, so you should just remove it.

GO is a batch separator for some clients.
Evil Kraig F
Evil Kraig F
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7809 Visits: 7660
malik_nagel (11/23/2010)
I want to run a "GO" and then pause for 5 seconds. When I run this code I get "A fatal scripting error occurred.
Incorrect syntax was encountered while parsing GO" Does anyone know why this and how I can run a pause after a GO?
These two statements run fine when they are separate.

Thanks!


As Michael mentioned above, it's a batch separator in SQL. Go 50 also loops the previous batch 50 times. THus, it doesn't like WAITFOR.

Best way is, if looping, start your batch with your waitfor, or just put it after the GO.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search