create table z1 (col1 int, col2 decimal, col3 nvarchar(100)); insert into z1 (col1, col2, col3) values (1, 2, 'i like cheese')
create table z2 (col1 int primary key, col2 decimal, col3 nvarchar(100)); insert into z2 (col1, col2, col3) values (1, 2, 'i like cheese')
create view v1 as select col1, col2, col3 from z2 where col2 between 2 and 100
insert into v1 (col1, col2, col3) values (1, 2, 'foo')
insert into v1 (col1, col2, col3) values (3, 250, 'foo')
create view v2 as select col1, col2, col3 from z2 where col2 between 2 and 100 with check optioninsert into v2 (col1, col2, col3) values (1, 250, 'foo')
insert into v2 (col1, col2, col3) values (1, 250, 'foo')
So if we run the same query as before against this view with "with check option" defined, we get this crazy looking plan:
create view v3 as select col1 + 1 as a, col2, col3 from z2
insert into v3 (a, col2, col3) values (1, 250, 'foo')
Theme design by Jelle Druyts
Pick a theme: BlogXP sqlx BlogXP sqlx
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Conor Cunningham
E-mail