Check option for view
I am confused with how check option works on a view.
I crated a simple table
CREATE TABLE [dbo].[Test]( [Country] nvarchar NULL ) ON [PRIMARY]
And populate it with England, USA, Australia
I create a view as follows
CREATE VIEW dbo.TestView AS
Select country from dbo.Test where country = N'USA' WITH CHECK OPTION GO
I then do
Insert into dbo.TestView (country) Values(N'Canada');
which fails as expected.
I then do
Update dbo.TestView Set country = N'ddsffd'
It does not fail?
I get no rows when I do
select * from dbo.TestView
No comments:
Post a Comment