Get custom message of raised error in trigger

44 Views Asked by At

I am working on a C# project with Entity Framework Core 5. I have a trigger which raises an error:

RAISERROR ('Conflict column bla bla bla.', 10, 1)

In the debug I see following:

enter image description here

How can I get the custom message?

1

There are 1 best solutions below

0
Emaborsa On BEST ANSWER

As suggested by @Gert Arnold, using THROW instead of RAISERROR fixed the problem:

THROW 5100, `Conflict column bla bla bla.', 1