SQL Server 2008 R2中的用户权限 [英] User permissions in SQL Server 2008 R2

查看:127
本文介绍了SQL Server 2008 R2中的用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL Server 2008 R2中的用户/登录名执行以下操作所需的哪种类型的服务器级角色数据库级角色权限

1)创建/更新/删除表,视图和存储过程
2)执行存储过程.

谢谢
Raghu

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

推荐答案

您需要区分两个单独的概念.

需要登录名(凭据)才能登录到SQL Server.例如,您可以使用创建登录名 [ ^ ]语句.如果登录需要特殊的服务器特权,例如创建数据库或备份数据库的能力,则您 GRANT [ ^ ]任何固定的服务器角色 [创建此登录名,以此数据库的数据库用户身份登录USER [ ^ ]语句.之后,您可以根据固定的数据库角色授予适当的数据库级别特权 [ ^ ]和/或您可以使用创建角色 [ ^ ]语句,并将这些角色授予数据库用户.

而且,当您连接到SQL Server时,请不要忘记设置要使用的数据库.这可以通过连接字符串来完成,您可以为登录名定义默认数据库,也可以使用来更改当前数据库. 使用 [
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.


选中此项.您会得到一个主意.

http://msdn.microsoft.com/en-us/library/ms189121.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/ms188659.aspx [ ^ ]
Check this. You will get an idea.

http://msdn.microsoft.com/en-us/library/ms189121.aspx[^]

http://msdn.microsoft.com/en-us/library/ms188659.aspx[^]


1.创建/更新/删除表,视图和存储过程
然后给

db_datawriter

2.如果您正在寻找执行存储过程的角色,那么

检查一下.

http://tiredblogger.wordpress.com/2008/04 /07/sql-server-2005-stored-procedures-executor-role/ [
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/[^]


这篇关于SQL Server 2008 R2中的用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆