No, there is nothing in SQL Server that fits this request.
The place to file suggestions like this is https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This feature prevents UPDATE
or DELETE
queries from executing unless they include a WHERE
clause or a LIMIT
. It's a safeguard against accidental table-wide modifications and helps maintain data integrity.
I believe SQL Server would greatly benefit from a similar feature. Here's how it might work:
SET SAFE_UPDATES ON;
→ Blocks UPDATE
and DELETE
without WHERE
or TOP
clauses.SET SAFE_UPDATES OFF;
→ Disables this restriction.Currently, SQL Server users rely on triggers or policies to achieve this behavior, which is cumbersome compared to a built-in option.
Does SQL Server have a similar feature or workaround? If not, would Microsoft consider adding this in a future release?
No, there is nothing in SQL Server that fits this request.
The place to file suggestions like this is https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0