为什么在关键字' read'?
附近出现错误的语法错误create view viewJab
as
select kojab,nmjabatan
from jabatan
with read only;
错误:
Msg 156,Level 15,State 1,Procedure viewJab,Line 5
关键字' read'附近的语法不正确。
答案 0 :(得分:0)
create view viewJab
with SCHEMABINDING
as select kojab,nmjabatan
from dbo.jabatan
DENY UPDATE ON dbo.viewjab TO username
答案 1 :(得分:0)
使用INSTEAD OF
触发器:
创建视图:
create view viewJab as
select kojab,nmjabatan
from jabatan;
<强> TRIGGER:强>
CREATE TRIGGER dbo.ViewJab_Trigger_OnInsertOrUpdateOrDelete]
ON dbo.viewJab
INSTEAD OF INSERT, UPDATE, DELETE
AS
BEGIN
RAISERROR ('You are not allow to update this view!', 16, 1)
END