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
 SQL Server Administration (2005)
 Users access levels

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2008-12-21 : 23:39:42
Hello All,

Is it possible for a user to only be able to access one database on a particular server? I just created a user account that suppose to only have access to one table, but when I login as that user, I was able to access all the databases on that server. Does anybody know how to setup a user account that only have access to one database instead the entire database in the server? Furthermore that user account should be able to create tables inside the assigned database. Please advice. Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 00:27:48
Yes that is possible. Since you want the user to create tables in the database, you'll probably want to assign it db_owner, otherwise you can specifically grant create table access but it'll be through their own schema.

So what access did you grant the user that you created? It sounds like you granted too much.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2008-12-22 : 19:18:54
Thanks for the response tkizer,

the following is what was granted to this user:
Server Roles
Sysadmin
User Mapping
Users mapped to this login
One table is checked
Database role membership for: AdventurWorks
Public

Please advice me on how to limit this user to one table only.

Thanks
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-22 : 19:31:20
You have remove user from sysadmin.with sysadmin,user can perform any actions.Read Booksonline about server role,database roles,object-level permission.
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2008-12-22 : 19:39:36
Thanks for the response sodeep, I recreated the user access not to include sysadmin role and it works!

Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 22:51:12
Why would you grant sysadmin to the user in the first place?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -