August 30, 2018 at 11:02 am
SQL server makes it simple to capture error numbers <50000 using ERROR_NUMBER(), ERROR_MESSAGE(), etc. However, suppose I create a custom error, for example error# 6598745, severity 12, description "The pallet move you are attempting is not allowed (palletid %u, locationid%s) because that location has not been released by QA."
If my stored procedure code validates against this business logic, and the pallet moves fails, I would like to capture (store in a logging table) the message details, including the message text. Does anybody have experience capturing and logging the complete RAISERROR text, number, etc? Thanks, David
August 30, 2018 at 11:03 am
DavidL - Thursday, August 30, 2018 11:02 AMSQL server makes it simple to capture error numbers <50000 using ERROR_NUMBER(), ERROR_MESSAGE(), etc. However, suppose I create a custom error, for example error# 6598745, severity 12, description "The pallet move you are attempting is not allowed (palletid %u, locationid%s) because that location has not been released by QA."
If my stored procedure code validates against this business logic, and the pallet moves fails, I would like to capture (store in a logging table) the message details, including the message text. Does anybody have experience capturing and logging the complete RAISERROR text, number, etc? Thanks, David
Same way.
August 30, 2018 at 11:10 am
Huh. That was easy :Whistling:
Since I had never seen an example of it after a day of web 'research', I assumed it was difficult.
Thanks.
August 30, 2018 at 11:14 am
Glad to help.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply