A T-SQL trigger returns rows to the client of the statement that fired it

tx0/sql:trigger-returns-resultsrecommendedwarningreliability/control-flowdepth fastbug

What it finds

A SELECT in a SQL Server trigger that returns rows sends them to whatever client ran the statement that fired the trigger, which does not expect them. Returning results from triggers is deprecated and can be turned off server-wide.

From the rule's source, trigger_returns_results.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/sql:trigger-returns-results" = "warning"

To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.

tx0 explain tx0/sql:trigger-returns-results shows the same in the terminal. Found a false positive? Report it.