mssql instead of 触发器应用一-创建只读视图(view)的方法

转自:

http://www.maomao365.com/?p=4906

<span style="color:white;background-color:blue;font-weight:bold;">
一、instead of 触发器应用一创建只读视图的方法
</span>
<span style="color:red;font-weight:bold;">
由于instead of 是代替 表或视图 执行insert update delete 语句的触发器,
当我们创建相应的触发器后,我们对对象执行 insert update delete 操作时,会直接跳入instead of 触发器中进行执行。
</span>
例:
<pre>
create trigger [触发器名称] on [视图名称]
instead of insert ,update ,delete
as
begin
-----将insert update delete 操作全部返回
return ;
end
</pre>

相关阅读:

mssql instead of 触发器简介
mssql sql server上如何建一个只读视图–视图锁定的另类解决方案

原文地址:https://www.cnblogs.com/lairui1232000/p/7477798.html