Emaborsa
Emaborsa

Reputation: 2880

Get custom message of raised error in trigger

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?

Upvotes: 1

Views: 58

Answers (1)

Emaborsa
Emaborsa

Reputation: 2880

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

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

Upvotes: 0

Related Questions