开发者

user defined exceptions

开发者 https://www.devze.com 2023-02-25 11:11 出处:网络
Are there user-defined except开发者_Go百科ions in tsql ?RAISERROR Generates an error message and initiates error processing for the

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

精彩评论

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