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
 Protect a table

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2008-08-13 : 08:36:17
Is there any way to protect a table in db. I mean if anybody want to manually open this table by sql enterprise then it should ask some password or some permission.

Is it possible?
I am using SQL server 2000

shaji

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-08-13 : 08:53:39
don't give them select permissions on that table, or even explicitly DENY

Em
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-08-13 : 08:56:15
You can create a trigger like this
CREATE TRIGGER trgAll ON MyTable
AFTER INSERT, UPDATE, DELETE

IF SUSER_SNAME() <> 'sa'
ROLLBACK TRANSACTION
to revert evertything anyone else than sa does in that table.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-08-14 : 00:01:10
>> I mean if anybody want to manually open this table by sql enterprise then it should ask some password.

No, you can't.
Go to Top of Page
   

- Advertisement -