# Get error message from SP SQL Server. display message with error type

**URL:** <https://forum.inductiveautomation.com/t/get-error-message-from-sp-sql-server-display-message-with-error-type/22662>\
**Category:** Ignition\
**Created:** [February 18, 2019, 11:53pm UTC](https://forum.inductiveautomation.com/t/get-error-message-from-sp-sql-server-display-message-with-error-type/22662 "2019-02-18T23:53:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juang](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@juang](https://forum.inductiveautomation.com/u/juang)\
**Post date:** [February 18, 2019, 11:53pm UTC](https://forum.inductiveautomation.com/t/get-error-message-from-sp-sql-server-display-message-with-error-type/22662/1 "2019-02-18T23:53:35Z")

</div>

I Need to get the error message from and SP or a Transaction and use it with Ignition. for example.

if we have a duplicate fail insert, i want to catch that error , identify it, and then display an error message box saying ’ Can’t insert a duplicate name’. if the error was for example something different, then do the same and display a different message like for example: ‘Can’t insert the a negative value into Cases amount’.

a way to do this would be to pass the Message Error into an Out parameter, but the problem is that ignition won’t let me use the Out parameter if an SP it’s rolled back.

Any ideas on how to achieve this?

---

<div class="post-metadata">

**Author:** ![David](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@David](https://forum.inductiveautomation.com/u/David)\
**Post date:** [November 16, 2020, 6:44pm UTC](https://forum.inductiveautomation.com/t/get-error-message-from-sp-sql-server-display-message-with-error-type/22662/2 "2020-11-16T18:44:44Z")

</div>

I have the exact same issue. Did you come up with a resolution? I notice no replies, unfortunately. Thanks, David

---

<div class="post-metadata">

**Author:** ![tyrel.parker](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@tyrel.parker](https://forum.inductiveautomation.com/u/tyrel.parker)\
**Post date:** [November 16, 2020, 7:16pm UTC](https://forum.inductiveautomation.com/t/get-error-message-from-sp-sql-server-display-message-with-error-type/22662/3 "2020-11-16T19:16:16Z")

</div>

Check: [DB Tables and Unique or duplicate values](http://forum.inductiveautomation.com/t/db-tables-and-unique-or-duplicate-values/39678/18)
