简体   繁体   中英

How to remove a user from SQL Server 2014?

If I open SQL Server 2014 Management Studio GUI and connect to my database, I can expand the database > Security > Logins to see the list of users that can login.

I'm trying to find out the SQL statement that I can use to remove one of those users (I need an automated solution).

I've tried

drop login 'BUILTIN\Users'

delete from master..syslogins where loginname = 'BUILTIN\Users'

drop user 'BUILTIN\Users'

from the drop commands, I get the error

Incorrect syntax near 'BUILTIN\\Users'

and the delete throws

Ad hoc updates to system catalogs are not allowed

不要使用引号,而是使用括号。

DROP LOGIN [BUILTIN\Users]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM