Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to prevent deletion from a table

Author  Topic 

Iyorshe
Starting Member

3 Posts

Posted - 2009-09-16 : 08:14:39
please some should show me a code in TSQL to preveent deletion from
a table or using the Enterprise manager

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-16 : 08:24:56
DENY DELETE ON <table_name>

or create an INSTEAD OF DELETE trigger on the table
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-16 : 12:18:17
I prefer the first approach...dont give delete permission
Go to Top of Page

Iyorshe
Starting Member

3 Posts

Posted - 2009-09-16 : 12:52:06
i tried the first code (deny delete on region)and it give me this error incorrect snytax near
region
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-16 : 12:53:48
deny delete on region to <your denied user account>
Go to Top of Page

Iyorshe
Starting Member

3 Posts

Posted - 2009-09-16 : 13:02:03
thank u very much it work i'm very grateful
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-16 : 13:04:22
welcome
Go to Top of Page
   

- Advertisement -