Joey D’Antoni pulls out the big guns:
However, SQL Server 2025 gives us a bigger hammer (DBAs love hammers). Building on top of the query store hints feature that was added in SQL Server 2022, ABORT_QUERY_EXECUTION simply blocks the exection of known problematic queries.
Read on to see how this works. Note that it will prevent the query from running at all, ever. As a result, if your main concern is “Hey, don’t run this during the busiest hours of the data for this database,” this particular hint is overkill.