문제

I would like to execute the following query :

DENY DELETE ON tableTest to Domain\Username

but it prints

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

i tried

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

but it also didn't work. The Domain\Username is the value i get in sys.database_principals

Any idea?

Thanks

도움이 되었습니까?

해결책

You can use [] to be able to use otherwise invalid characters for identifiers:

DENY DELETE ON tableTest to [Domain\Username]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top