SQL: Notify Client about progress in long running process

RAISERROR (N'After 2', -- Message text           10, -- Severity           1) -- State       WITH NOWAIT

The thing to note here is the use of NOWAIT option.

This flushes all waiting resultsets and messages back to the client.

Also note the use of non fatal severity and state, since we don’t
want to cancel our script but only inform the user of the progress.

It comes in very handy when running script that can take a while indeed.
ref: link


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 )

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 )


Connecting to %s

%d bloggers like this: