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 2008 Forums
 SQL Server Administration (2008)
 create a user login to my db with only a few permi

Author  Topic 

sebastian11c
Posting Yak Master

129 Posts

Posted - 2012-11-06 : 16:16:29
hi there

i have a sql server 2008 r2 and i want to create a user with login , that only have access to a database called "company" and inside the databse company he can only select , update , and insert in 3 tables called " products", "sevices", "clients", and run only one stored procedured called "insert_new_clients" and thats it, he cant acces anything else, no system database, no other sp, no other tables, and obviously he cant modified his permissions,

am a newbie in sql server so i need you help

many thanks in advanced

regards

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2012-11-06 : 16:29:32
Are you looking for T-Sql code or simply how to navigate the Management Studio interface?

Sounds like you have it already. Just be sure not to add the login to any server roles and not to add the user to any database roles. That way the user has no permissions that you didn't explicitly grant. Furthermore if the SPs perform the insert/update/delete work and the SPs are in the same database as the tables then you don't even need to grant insert,update,delete on the tables. Just EXECUTE on the Procedure(s) will be sufficient.

Be One with the Optimizer
TG
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 2012-11-06 : 16:57:47
thanks tg for your reply

but i dont have it at all, could you explain me please with an example, ,it can be with t-sql or managemente studio interface,,
thanks for your help

regards
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 2012-11-07 : 08:31:32
quote:
Originally posted by TG

Are you looking for T-Sql code or simply how to navigate the Management Studio interface?

Sounds like you have it already. Just be sure not to add the login to any server roles and not to add the user to any database roles. That way the user has no permissions that you didn't explicitly grant. Furthermore if the SPs perform the insert/update/delete work and the SPs are in the same database as the tables then you don't even need to grant insert,update,delete on the tables. Just EXECUTE on the Procedure(s) will be sufficient.

Be One with the Optimizer
TG



please tg, i dint know how to do it, give me an extra hand

regards
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2012-11-07 : 10:09:01
>>please tg, i dint know how to do it, give me an extra hand

- Open "Microsoft Sql Server Management Studio"
- Make sure that "Object Explorer" is open (if not then from context menu: View | Object explorer)
- Find your server in tree view (if not there then click: Connect | Database Engine)
- Expand the tree under your server
- Expand "Logins"
- Right Click "Logins" then click "New Login".

See if you can take it from there. Be sure to look through the "select a page" items. If you still have problems then post a specific question.

EDIT:
Once you have the login created:
- expand databases
- expand the database you want the login to access.
- expand "Security"
- expand "Users"
- If the user is not there then right-click | new users
- If it is there then right-click the user | Properties
- Add specific permissions in the "Securables" page

Be One with the Optimizer
TG
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 2012-11-07 : 10:29:19
lovely..

thanks a lot
Go to Top of Page
   

- Advertisement -