Press "Enter" to skip to content

Day: December 2, 2026

Validating JSON in SQL Server and .NET

Syed Salman validates some JSON:

Over time, I’ve encountered various issues with JSON during API (application programming interface) integration and data processing. Sometimes, a third-party API returns a different format. Other times, some fields are missing.

These problems are usually identified from API errors, incorrect data in the database, or issues reported by users.

Most developers assume the JSON coming from their own application or from a third-party API will always be correct, so sometimes skip validation to save time.

The result? Potential issues later on: runtime errors, incorrect data, or production issues that are difficult to debug.

The, err, people of distinguished age in the audience will probably look at this and say, “This was the whole point of XML.”

Leave a Comment

A Survey of Triggers in Microsoft SQL

Aleksey Vitsko gives us some triggers:

A trigger in SQL Server (and Azure SQL) is a special kind of stored procedure that executes automatically in response to a specific event inside the database engine.

A trigger can be bound to a database object, to database scope, or to a server scope. Unlike normal stored procedures, a trigger is never called manually.

Triggers are tightly integrated with SQL Server’s internal event system. When an event fires, SQL Server executes the trigger as part of the same transaction (for DML and many DDL operations), meaning the trigger can inspect the change, modify or add data, log to a table, or even roll back the entire transaction.

Read on for the taxonomy and when you might use each.

Leave a Comment

Assigning Permissions to Table Types in SQL Server

Greg Low explains:

When you use table types in SQL Server, you need to assign permissions on them, and usually EXECUTE permissions. On one of my mailing lists, I saw a posting about how the user was trying to assign permissions to a table type  (for use as a table-valued parameter), and was getting this error:

Msg 15151, Level 16, State 1, Line 11 Cannot find the object, because it does not exist or you do not have permission.

Read on to understand what the issue was, how to correct it, and why it’s an issue in the first place.

Leave a Comment