SQL – Simple way to return messages at runtime instead of using PRINT

Care of David Poole of SQLServerCentral: http://www.sqlservercentral.com/articles/Documentation/72473/

 

 

RAISERROR ( ‘DATA DICTIONARY: %i tables & %i fields added’, 10, 1,

    @TableCount, @FieldCount ) WITH NOWAIT

The “10” parameter is the SEVERITY of the error message raised.

10 : this is more of a notice message, or minor alert

16 : this is reserved for true error messages

You can find more via:

http://msdn.microsoft.com/en-us/library/ms178592.aspx

Advertisements

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