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 2012 Forums
 SQL Server Administration (2012)
 create user

Author  Topic 

subhaoviya
Posting Yak Master

135 Posts

Posted - 2014-03-26 : 08:07:10
Hi,
I have created one database DB1, I need to create access permission for user1 to access only that newly created databse DB1 and need to grand permission for create table, sp,...

How to do that?

I have created user under security-->logins with server role public. but the user1 not able to create table with this permission level.

Thanks
Subha

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-03-26 : 11:49:28
What other permissions will the user need? I suspect db_owner is needed for this user.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2014-03-27 : 14:00:47
A login grants access to SQL Server, a user in a database grants access to that database. You then grant permissions to that user - in that database through individual permissions or by giving that user a role. You can use one of the built in roles - or create your own.

If you want the user to be able to create tables/stored procedures/functions/etc... in any schema, you can give them the ddl_admin role. For read access to any schema, add them to the db_datareader role and for write access to any schema add them to the db_datawriter role.

To give them the ability to execute any procedure in the 'dbo' schema, use the following: GRANT EXECUTE ON schema::dbo TO {user/role};

If you only want them to be able to do things in their own schema, you just need to create the user and make them an owner of that schema. As owner of the schema, they have full permissions to create objects in that schema and execute procedures in that schema - but no permissions in any other schema unless specifically granted.

Go to Top of Page
   

- Advertisement -