Search

Thursday 17 February 2011

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://www.sqlservercentral.com/articles/SQL+Puzzles/quickhintsforusingtheraiserrorcommand/2114/

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

No comments:

Post a Comment