不小心update忘记添加条件,简单限制下!
trigger针对DML频繁操作时性能不佳 ,注意自己实际情况!
create trigger tr_tblTime
on tblTime
for update,delete
as
if ORIGINAL_LOGIN()in ('wind','snow')
and (select count(*) from deleted)> 10
BEGIN
RAISERROR ( 'Serious error, please contact the DBA',16,1)
ROLLBACK TRANSACTION
RETURN
END
go
查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/
时间: 2024-11-05 06:02:58