我想知道SQL查询将确定我是否具有INSERT权限,例如。员工表?
我怎么能问这个sql server?
谢谢
答案 0 :(得分:0)
根据MSDN文档,授予不同类型权限的语法是
GRANT <permission> [ ,...n ] ON
[ OBJECT :: ][ schema_name ]. object_name [ ( column [ ,...n ] ) ]
TO <database_principal> [ ,...n ]
[ WITH GRANT OPTION ]
[ AS <database_principal> ]
<permission> ::=
ALL [ PRIVILEGES ] | permission [ ( column [ ,...n ] ) ]
<database_principal> ::= Database_user
| Database_role
| Application_role
| Database_user_mapped_to_Windows_User
| Database_user_mapped_to_Windows_Group
| Database_user_mapped_to_certificate
| Database_user_mapped_to_asymmetric_key
| Database_user_with_no_login
因此,遵循语法,可以将Employee Table的INSERT权限授予像这样的用户
GRANT INSERT ON <your db name>.Employee TO <username>