SQL Server中的“GRANT ALL TO role”

时间:2020-11-29 09:12:05

Please can someone explain what the following statement does in SQL Server 2005:

请有人解释下面的语句在SQL Server 2005中的作用:

GRANT ALL TO pax_writer

pax_writer is a database role previously created using the statement

pax_writer是以前使用该语句创建的数据库角色

CREATE ROLE pax_writer AUTHORIZATION dbo

2 个解决方案

#1


3  

Grants database permissions

授予数据库权限

This is the only time you can leave the ON ThingsAndStuff clause out.

这是唯一可以将ON ThingsAndStuff子句保留的时间。

ALL

This option does not grant all possible permissions. Granting ALL is equivalent to granting the following permissions: BACKUP DATABASE, BACKUP LOG, CREATE DATABASE, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, and CREATE VIEW.

此选项不授予所有可能的权限。授予ALL等同于授予以下权限:BACKUP DATABASE,BACKUP LOG,CREATE DATABASE,CREATE DEFAULT,CREATE FUNCTION,CREATE PROCEDURE,CREATE RULE,CREATE TABLE和CREATE VIEW。

#2


2  

GRANT ALL TO "someone" grants all permissions for all objects available in the database. But I'm not sure this is suppose to work in sql server 2005 as far as I'm concerned they left "GRANT ALL" only for backward compatibility.

全部授予“某人”授予数据库中所有可用对象的所有权限。但我不确定这是假设在sql server 2005中工作,因为我担心他们只是为了向后兼容而离开“GRANT ALL”。

According to the article in sql server 2005 works like this:

根据sql server 2005中的文章,这样工作:

  1. If the securable is a database, "ALL" means BACKUP DATABASE, BACKUP LOG, CREATE DATABASE, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, and CREATE VIEW.
  2. 如果安全性是数据库,则“ALL”表示BACKUP DATABASE,BACKUP LOG,CREATE DATABASE,CREATE DEFAULT,CREATE FUNCTION,CREATE PROCEDURE,CREATE RULE,CREATE TABLE和CREATE VIEW。

  3. If the securable is a scalar function, "ALL" means EXECUTE and REFERENCES.
  4. 如果安全性是标量函数,则“ALL”表示EXECUTE和REFERENCES。

  5. If the securable is a table-valued function, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  6. 如果安全性是表值函数,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

  7. If the securable is a stored procedure, "ALL" means EXECUTE.
  8. 如果安全性是存储过程,则“ALL”表示执行。

  9. If the securable is a table, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  10. 如果安全性是表,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

  11. If the securable is a view, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  12. 如果安全性是视图,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

Hopefully someone will the right answer

希望有人会得到正确的答案

MSDN - GRANT

MSDN - GRANT

#1


3  

Grants database permissions

授予数据库权限

This is the only time you can leave the ON ThingsAndStuff clause out.

这是唯一可以将ON ThingsAndStuff子句保留的时间。

ALL

This option does not grant all possible permissions. Granting ALL is equivalent to granting the following permissions: BACKUP DATABASE, BACKUP LOG, CREATE DATABASE, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, and CREATE VIEW.

此选项不授予所有可能的权限。授予ALL等同于授予以下权限:BACKUP DATABASE,BACKUP LOG,CREATE DATABASE,CREATE DEFAULT,CREATE FUNCTION,CREATE PROCEDURE,CREATE RULE,CREATE TABLE和CREATE VIEW。

#2


2  

GRANT ALL TO "someone" grants all permissions for all objects available in the database. But I'm not sure this is suppose to work in sql server 2005 as far as I'm concerned they left "GRANT ALL" only for backward compatibility.

全部授予“某人”授予数据库中所有可用对象的所有权限。但我不确定这是假设在sql server 2005中工作,因为我担心他们只是为了向后兼容而离开“GRANT ALL”。

According to the article in sql server 2005 works like this:

根据sql server 2005中的文章,这样工作:

  1. If the securable is a database, "ALL" means BACKUP DATABASE, BACKUP LOG, CREATE DATABASE, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, and CREATE VIEW.
  2. 如果安全性是数据库,则“ALL”表示BACKUP DATABASE,BACKUP LOG,CREATE DATABASE,CREATE DEFAULT,CREATE FUNCTION,CREATE PROCEDURE,CREATE RULE,CREATE TABLE和CREATE VIEW。

  3. If the securable is a scalar function, "ALL" means EXECUTE and REFERENCES.
  4. 如果安全性是标量函数,则“ALL”表示EXECUTE和REFERENCES。

  5. If the securable is a table-valued function, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  6. 如果安全性是表值函数,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

  7. If the securable is a stored procedure, "ALL" means EXECUTE.
  8. 如果安全性是存储过程,则“ALL”表示执行。

  9. If the securable is a table, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  10. 如果安全性是表,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

  11. If the securable is a view, "ALL" means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.
  12. 如果安全性是视图,则“ALL”表示DELETE,INSERT,REFERENCES,SELECT和UPDATE。

Hopefully someone will the right answer

希望有人会得到正确的答案

MSDN - GRANT

MSDN - GRANT