Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What type of Server level role, Database level role permissions required for a user/login in SQL Server 2008 R2 to perform following

1) To create/update/delete table, views, and stored procedure
2) To execute stored procedures.

Thanks
Raghu
Posted

You need to distinguish two separate concepts.

A login (credentials) are required to log on to SQL Server. You can for example create a login for a named person by using CREATE LOGIN[^] statement. If the login needs special server priviliges such as ability to create a database or to backup a database you GRANT[^] any of the fixed server roles[^] to the login.

In order for the login to access a specific database you need to make the login a database user for this database using CREATE USER[^] statement. After that you can grant proper database level privileges based on the fixed database roles[^] and/or you can create roles of your own using CREATE ROLE[^] statement and grant these roles to the database user.

And when you connect to the SQL Server, don't forget to set the database you want to work in. This can be done via the connection string, you can define a default database to the login or you can change the current database using the USE[^] command.
 
Share this answer
 
Comments
Raghunatha_Reddy_S 10-Aug-12 3:28am    
Thanks for your reply. My requirement is
1) I required one user to create database, tables, stored procedures and views.
2) Another user to access the data in the tables and execute stored procedures only.
Could you please tell me what server level and database level permissions required for these, I have little bit confusion in this.
Wendelius 10-Aug-12 3:41am    
For the first user, create the login and grant dbcreator server role. After that this user can create the database and all necessary objects (tables, procedures and so on) inside it.

For the second user, create the login and after that create the login as a database user to your new database using the CREATE USER command. To read all the data from all the tables, you can grant this user a db_datareader database role.

Also note that you can do this also via SSMS if you like to do it using the graphical user interface.
Raghunatha_Reddy_S 10-Aug-12 4:33am    
Thanks
Wendelius 10-Aug-12 5:06am    
You're welcome :)
 
Share this answer
 
Comments
Raghunatha_Reddy_S 10-Aug-12 3:29am    
Thanks
1. To create/update/delete table, views, and stored procedure
then give

db_datawriter

2.If you are looking for a role to execute stored proc, then

Check this.

http://tiredblogger.wordpress.com/2008/04/07/sql-server-2005-stored-procedures-executor-role/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900