|  | Posted by Damien on 03/23/07 15:15 
On Mar 23, 10:34 am, othell...@yahoo.com wrote:> On Mar 23, 4:13 pm, othell...@yahoo.com wrote:
 >
 > > On Mar 23, 4:06 pm, othell...@yahoo.com wrote:
 >
 > > > How do I make a view non updateable? I want to create a view so that I
 > > > will not be able to update, insert or delete the view so that base
 > > > table is not affected (except dropping the view itself). Thanks.
 >
 > > I have tried:
 > > revoke delete,insert,update on v_t1 to dbo
 >
 > > bit its not working...
 >
 > Okay found a solution. If I introduce an aggregate function then it
 > works. So I ended up aggregating all the columns from the select list.
 > So instead of saying:
 > Create view view1 as
 > Select column1, column2
 >
 > >From Base_table
 >
 > Not Updateable:
 > Create view view1 as
 > Select column1, column2>From Base_table
 >
 > Group by column1,column2
 >
 > I wish there is an easier way than this.
 
 create trigger T_NoUpdates on view1 INSTEAD OF INSERT,UPDATE,DELETE AS
 RAISERROR('No updates allowed',16,1)
 
 Damien
  Navigation: [Reply to this message] |