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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to prevent delete table from my DB

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-09-03 : 05:33:44
how can i prevent to delete Table?

if i added a trigger so i need to write Rollback.
the problem if someone delete table so big, so i have rollback on big table.

is anobther alternative to prevent from someone to delete table?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-03 : 05:38:03
How would it be to give not all users the right to do some deletes?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-09-03 : 05:45:39
ok, i understand you.

i just want to prevent from develpoers to delete DB
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-03 : 05:49:00
quote:
Originally posted by inbs

ok, i understand you.

i just want to prevent from develpoers to delete DB



Revoke the permission

Revoke Delete on <table_name> to <user_name>

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

ScottWhigham
Starting Member

49 Posts

Posted - 2009-09-03 : 08:47:44
quote:
Originally posted by inbs
Revoke the permission

Revoke Delete on <table_name> to <user_name>
I think you meant:

DENY DELETE ON <table_name>

REVOKE would clear the permission.

And OP - the only way to prevent deletes without issuing any rollbacks is to deny the permission in the first place.

========================================================

I have about 1,000 video tutorials on SQL Server 2008, 2005, and 2000 over at http://www.learnitfirst.com/Database-Professionals.aspx
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2009-09-03 : 14:16:33
Have you considered creating a DDL Trigger?

=======================================
Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
Go to Top of Page
   

- Advertisement -