August 4, 2010 at 3:24 am
In a DB, A user needs to have access to create new tables, but for certain tables that user should have only read permissions(no modifications). In What ways this can be done?
August 4, 2010 at 4:05 am
In a DB, A user needs to have access to create new tables, but for certain tables that user should have only read permissions(no modifications). In What ways this can be done?
Hi,
Go through Server Rolse & User Mapping concepts.
Create DDL trigger as per your requirements.
Cheers!
Sasidhar Pulivarthi
August 4, 2010 at 4:53 am
To create tables, I can give ddl_admin access (DB role) to the user. But, then he would have full access to those tables for which he should have only read access. How to go about it?
August 4, 2010 at 5:14 am
If this is a new database that you are designing, I would strongly recommend the use of schemas. With the user-schema isolation coming in from SQL 2005, the task at hand will become much simpler (the user can have modification rights for a particular schema, but on the other, they can only have read rights).
If this is a pre-existing database, the only option I have the use of triggers (never done before :))
Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Follow me on
Twitter: @sqltwins
August 4, 2010 at 7:07 am
You can give object level permission to a user..
You can give only select on tables
August 4, 2010 at 7:18 am
I am having 2 sets of users. One set(say A) should have only read-access to all the tables in a db. The other set (say B) should have permissions to create tables/views etc and read-access to all the tables in the db.
Will the below option work?
1. Giving db_datareader access to users (A), so that they can only use SELECT on all the tables.
2. Giving DDL_ADMIN to (B), and using the below script
DENY INSERT ON OBJECT::Test TO ;
GO
DENY UPDATE ON OBJECT::Test TO ;
GO
DENY DELETE ON OBJECT::Test TO ;
GO
--getting "Incorrect syntax near 'DROP'" for below part
DENY DROP ON OBJECT::Test TO ;
GO.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply