Sleep in T-SQL / SQL Server script

Sometimes you need to make a script sleep for a short period of time, either for debugging purposes, or to make sure that something else has time to finish. To do this in T-SQL, you can use this command, which took me a lot of googling to find;

WAITFOR DELAY '00:00:00:50' -- 50ms delay

About mfagerlund
Writes code in my sleep - and sometimes it even compiles!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: