SQL Server 2019: Rasing errors between 1 and 13000 I've been struggling with a task which requires me to raise a number of errors for testing purposes. Of course the time consuming errors are between 1 and 13000. I've managed to do them, but I need to do it several times on multiple test instances and I wanted to ask if there's a way to raise SQL Engine errors which normally only could be raised by the engine itself. By 'a way', I mean any possible routes to generate those error messages.
The ultimate goal is that the messages appear in the current error log.
Any help would be appreciated!
Try RAISERROR syntax below;
RAISERROR(
          'Test error' -- Error message
          ,0 -- Severity
          ,1 -- State
         ) WITH LOG;

For more information, you can check out the document.