Font colour (color) used in SQL Server Management Studio (SSMS)

It's a bit of an old post, but if you still want to be able to display your text in red: use the built in RAISERROR function. You can set the severity of the error and that will determine if it outputs your text in black or red. For example:

raiserror('Your error message', 10, 0)

Will display the error with just the black font color

raiserror('Your error message', 11, 0)

Will display the error with a red font color

Message severity of 10 or lower will use black font color, 11 or higher will use red font color.

For completion: message severity of 20 or higher will stop executing the rest of the script, and if you use a message severity of 19 or higher you have to call the raiserror function with the log option, like so:

 raiserror('Your error message', 20, 0) with log

Tags:

Ssms