Give any example of WaitFor Time command?

 Posted by Vishalneeraj-24503 on 3/1/2015 | Category: Sql Server Interview questions | Views: 1269 | Points: 40
Answer:

WaitFor Time '4:00';

--4 A.M.
DECLARE @DateTime DATETIME

SET @DateTime = DATEADD(s,9,GETDATE()) //9 seconds
SELECT GETDATE() CurrentTime
WaitFor Time @DateTime
SELECT GETDATE() CurrentTime;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response