2013-10-04 41 views
0

我想執行以下查詢:更改權與轉義字符用戶

DENY DELETE ON tableTest to Domain\Username 

但它打印

Msg 102, Level 15, State 1, Line 1 
Incorrect syntax near '\'. 

我試圖

SELECT @Test = 'Domain\Username'  
DENY DELETE ON tableTest to @Test 

,但它也沒」工作。 Domain \ Username是我在sys.database_principals中獲得的值

任何想法?

感謝

回答

0

您可以使用[]才能夠使用,否則無效字符identifiers

DENY DELETE ON tableTest to [Domain\Username]