FormatErrorMessage
Formats a string to be used in a multi-line error message
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT SQLHTTP.net.FormatErrorMessage ( @ErrorMessage )
Name | Type | Description |
---|---|---|
@ErrorMessage | nvarchar(4000) | String Expression to be formatted. |
nvarchar(4000)
HTML
tags as well as NCHAR(13) characters serve as line breaks.
1 2 3 4 5 6 7 |
DECLARE @ErrorMessage nvarchar(4000) SET @ErrorMessage = SQLHTTP.net.FormatErrorMessage('Pretty Error Line 1<br/>Pretty Error Line 2') RAISERROR(@ErrorMessage, 16, 1) |
Msg 50000, Level 16, State 1, Line 4
***********************
* Pretty Error Line 1 *
* Pretty Error Line 2 *
***********************
***********************
* Pretty Error Line 1 *
* Pretty Error Line 2 *
***********************