2015-10-13 87 views
0

請讓試圖授予用戶的特定角色時出現錯誤:SQL語法錯誤創建角色

Grant role role_1 to maintenance; 

錯誤:

Incorrect syntax near 'role_1'

是否要修改它,因此授予角色用戶工作

+0

[這裏](http://stackoverflow.com/questions/11008399/t-sql-how-to-grant-role-to-user)是您對SQL Server的回答 – cha

+0

我看不到SQL Server上的授予角色role_1修復程序。 – LebronJames

回答

0
GRANT {role_name} TO {user_name}; 

for T-SQL,下面是GRANT的簡化語法

GRANT { ALL [ PRIVILEGES ] } 
     | permission [ (column [ ,...n ]) ] [ ,...n ] 
     [ ON [ class :: ] securable ] TO principal [ ,...n ] 
     [ WITH GRANT OPTION ] [ AS principal ] 

在你的情況下,只需

GRANT role_1 TO maintenance; 
+0

謝謝但由於某種原因仍然出現語法錯誤 – LebronJames