WAITFOR it …

There are times when you want to delay a script such as sending yourself a reminders or to run a job/stored procedure/etc.

Wait by Time

BEGIN
             WAITFOR TIME ’01:10′;
PRINT ‘This message will print at 1:10 am’;
END;

Wait by Delay

BEGIN
             WAITFOR DELAY ’01:00′;
PRINT ‘This message will print in one hour’;
END;

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s