January 31, 2025 at 12:00 am
Comments posted to this topic are about the item JSON in Microsoft SQL Server: A Comprehensive Guide
January 31, 2025 at 11:43 am
This is a good round-up of what is possible with JSON and SQL Server. Well done on putting it together.
My one non-JSON comment would be regarding the following:
Always implement proper error handling when working with JSON data:
While this is, of course, sound advice, it is followed by a code fragment where the CATCH block contains a SELECT of the errors occurring. Selecting errors in a CATCH block is not good practice, instead, use should be made of RAISERROR or THROW to make sure any errors do not get missed.
February 28, 2026 at 9:09 pm
Thank you, Phil, I really appreciate the feedback.
You are absolutely right. Simply selecting the error information inside the CATCH block is not ideal for production scenarios, as it does not rethrow the exception to the caller.
Using THROW to propagate the original error is the better practice, especially in modern SQL Server versions. I will update the example to reflect that.
Thanks again for pointing that out.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply