views:

63

answers:

5

While working with some random sql queries on our databases, we may not want to insert or delete items to some of the database tables by just typing their names by mistake. So how to make them locked to the "editing", to be able to work safe.

Thanks.

+2  A: 

Why not just define a role in your database and give that role rights to whatever tables your users need, but this role would not have update/delete rights to the tables you are concerned with?

dcp
A: 

Work with a limited-rights account, and deny it rights to modify the 'protected' tables.

CodeByMoonlight
+1  A: 

As the others have mentioned, this should be set up in the Roles.

Here is a useful link on Understanding Roles in SQL Server 2000

kevchadders
A: 

Roles are the best practice way to go. However if you can't/won't use roles, you could use triggers, see this answer: http://stackoverflow.com/questions/2551510/sql-server-query-editors-any-that-warn-of-number-of-rows-to-be-changed/2552658#2552658

KM
A: 

Move these special tables to its own database. Give the user account only select privileges for this database.

Rook