Enhancement to "Warning on delete and update statements if no WHERE clause is specified" (clarified)
This is a clarification to an earlier post. (https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/13543761-enhancement-to-warning-on-delete-and-update-state)
This is a great idea, but I was surprised by the number of "false positives" I am getting (and yes, I can just mute the messages completely).
In my case I am doing a lot of updates/deletes on permanent tables with joins to temporary tables or table variables and that limits the update/delete scope.
Can you add to this feature so that messages will not be emitted if there is a join to a temporary table or table variable?
Set SomeData = tt.SomeData
From dbo.RealTable As rt
Inner Join @TempTable As tt On tt.Id = rt.Id
This feature was released in version 7.3 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
The Prompt Team
I am using SQL Prompt version 126.96.36.1993 and don't see this as an option. Was it removed in version 8?
Having experienced this, it is a little annoying. But, when I was doing a few mass updates, the FROM clause and other JOINS did not limit the scope of my query. I added a new column and I wanted every row updated to the appropriate value. So I would argue that it's not the same as having a where clause. I didn't mind the warning because before I was completely paranoid that I would hit Ctrl-E by accident before I put a where clause on my statement.
An inner join is implicitly a Where clause so it makes perfect sense to allow one to be considered as criteria being supplied.
Tony Waddle commented
Having a setting to control the sensitivity would be nice