我有一個表值函數正在被安全策略引用。 我想ALTER
的功能,但我不能:SQL Sever 2016更改表值函數 - 更改安全策略
Msg 3729, Level 16, State 3, Procedure accessPredicate, Line 1
Cannot ALTER 'rls.accessPredicate' because it is being referenced by object 'EventSecurityPolicy'
嗯,但其中的安全策略GUI中發現了什麼?我檢查了模式,表格和函數。我會認爲,這將是在政策
玉以及我總是可以用T-SQL做
select *
from sys.security_policies
也許我就可以把它關掉
Alter security policy rls.EventSecurityPolicy
with (state = OFF);
沒有同樣的錯誤:
Msg 3729, Level 16, State 3, Procedure accessPredicate, Line 1
Cannot ALTER 'rls.accessPredicate' because it is being referenced by object 'EventSecurityPolicy'
OK,讓我們刪除
delete from sys.objects
where schema_id = schema_id('rls') and object_id='1253579504'
Msg 259, Level 16, State 1, Line 2
Ad hoc updates to system catalogs are not allowed.
How do you get past this sort of error: "Ad hoc updates to system catalogs are not allowed."?
OK,我會改變裝配..
select * from sys.assemblies
好吧,我不知道哪裏去了從這裏......
必須有一個更簡單的方法!我只是想改變一個功能!
試試這個'ALTER安全政策yourpolicy DROP過濾器/塊謂詞在桌子上# – TheGameiswar
完美的謝謝你......作爲筆記我哈d包含塊謂詞的AFTER UPDATE ...否則它說謂詞不存在。 添加爲答案&我將標記爲正確 –
您可以將該答案作爲答案發布,包含您的所作所爲,以及您正在嘗試做什麼和做了什麼,它可能會在未來幫助其他人 – TheGameiswar