开发者

user defined exceptions

Are there user-defined except开发者_Go百科ions in tsql ?


RAISERROR

Generates an error message and initiates error processing for the session. RAISERROR can either reference a user-defined message stored in the sys.messages catalog view or build a message dynamically. The message is returned as a server error message to the calling application or to an associated CATCH block of a TRY…CATCH construct.

from MSDN


You can define your own, custom error messages and use those when calling RAISERROR

SQL Server doesn't really have a concept of "exceptions" per se - but you can raise your own customer errors as shown above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜