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.
精彩评论