【发布时间】:2015-06-25 00:24:06
【问题描述】:
是否可以确定 Sybase ASE (v15.7) 中的现有视图是否具有WITH CHECK OPTION 子句?我创建了 2 个除该子句外相同的视图,并且所有系统表中的条目(例如sysobjects、syscomments、sysprotects 等)对于两个视图似乎都是相同的。 exec sp_helptext 不显示子句。
在 MSSQL 中,sys.views 有一个 with_check_option 列,但似乎没有 ASE 的等效项。
在下面的示例中,WITH CHECK OPTION 子句完全按预期工作,即插入到check_test_2 失败,除非将visible 设置为Y。有没有办法确定哪些视图设置了WITH CHECK OPTION 子句?
示例代码:
use tempdb
go
if object_id('check_test') is not null drop table check_test
go
create table check_test (id int, visible char(1))
go
if object_id('check_test_1') is not null drop view check_test_1
go
create view check_test_1
as
select *
from check_test
where visible = 'Y'
go
if object_id('check_test_2') is not null drop view check_test_2
go
create view check_test_2
as
select *
from check_test
where visible = 'Y'
with check option
go
【问题讨论】: