Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I want to give different permission for different tables within a single database for a user.For example a user has full permission to a table while for another table only read permission.How it can be done within a database?

share|improve this question
2  
Which RDBMS are you using? –  FreshPhilOfSO Mar 21 '13 at 14:58
add comment

1 Answer

In Oracle (and, realistically, most any reasonable database), everything is denied other than what is granted. So simply grant the user the privileges you want him to have

GRANT select, update, delete
   ON table_owner.table_name
   TO username;

GRANT select
   ON table_owner.another_table_name
   TO username;
share|improve this answer
    
Same with SQL Server. –  Kenneth Fisher Mar 21 '13 at 15:25
    
Except that with SQL Server 2005+ it is ON schema.table_name. :-) –  Greenstone Walker Mar 25 '13 at 5:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.