Prevent multi-row updates with Trigger

The best way to do this would be with a trigger :

create trigger trig_single_updates_only on table_name
for update
as
begin
if (select count(*) from inserted) > 1
begin
raiserror ('You cannot update more than one row at time - please add an appropriete where clause',16,1)
rollback
end
end

Hiç yorum yok:

BlackListIP control on Serenity platform (.NET Core)

 In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...