|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
| Comments posted to this topic are about the item WAITFOR
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 6:57 PM
Points: 2,440,
Visits: 712
|
|
WAITFOR { DELAY 'time_to_pass' | TIME 'time_to_execute' | [ ( receive_statement ) | ( get_conversation_group_statement ) ] [ , TIMEOUT timeout ] }
I wondered when I answered the question about the service broker but it wasn't mentioned in the BOL so I figured I was okay.
http://msdn.microsoft.com/en-us/library/ms187331.aspx?n=0
Jamie
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 7:07 AM
Points: 1,146,
Visits: 1,847
|
|
I somewhat disagree that a TIMEOUT can be used to end a WAITFOR. It cannot be used independently and is only an optional modifier of the Service Broker message.
(PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, December 26, 2011 2:08 PM
Points: 196,
Visits: 54
|
|
receive_statement
Is a valid RECEIVE statement. Important: WAITFOR with a receive_statement is applicable only to Service Broker messages. For more information, see RECEIVE (Transact-SQL).
:D
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 11:21 AM
Points: 1,422,
Visits: 247
|
|
I think so. Timeout option is not directly related with WAITFOR TSQL is an optional part.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 11:21 AM
Points: 1,422,
Visits: 247
|
|
I agree. Timeout is an optional syntax of WAITFOR TSQL command
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:57 PM
Points: 1,491,
Visits: 3,008
|
|
This is a good QOD in that it prompted a careful reading of the syntax of an unfamiliar (to me, anyway) feature. The keywords "DELAY", "TIME", and "TIMEOUT" all sound so much like the same sort of thing that I had to read the definition of those terms two or three times. Let's see if I've got them straight now:
-- DELAY lets you specify an interval to wait after the WAITFOR statement is encountered before the rest of the SQL is executed. -- TIME is an alternative to DELAY in that it lets you specify a specific time of day at which you want your SQL to continue to execute. -- TIMEOUT gives you a safety net if you're waiting for a Service Broker message. Execution proceeds if the message hasn't arrived within the time you're willing to wait for it.
So, yes, all four options are correct answers as to what will terminate a WAITFOR, allowing the rest of the SQL to continue.
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:50 AM
Points: 4,785,
Visits: 1,334
|
|
Nice question.............:)
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:36 AM
Points: 2,522,
Visits: 3,616
|
|
I also missed that one because of the TIMEOUT. But re-reading the question revealed that the question writer had this in mind when choosing his wording. Tricky
Best Regards,
Chris Büttner
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:57 PM
Points: 7,079,
Visits: 7,121
|
|
Mauve (6/17/2008) I somewhat disagree that a TIMEOUT can be used to end a WAITFOR. It cannot be used independently and is only an optional modifier of the Service Broker message. I agree with Mauve, you can wait for a message or you can wait for whichever comes first, a message of a timeout, but you can't wait for just a timeout.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|