开发者

What is the SQL to delete a SQL User from a database?

开发者 https://www.devze.com 2023-01-16 20:49 出处:网络
What is the SQL to delete a SQL User fro开发者_JS百科m a database? DROP USER [UserName] You can prefix this with an existence check if required.

What is the SQL to delete a SQL User fro开发者_JS百科m a database?


 DROP USER [UserName]

You can prefix this with an existence check if required.

IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'UserName')

There are some requirements to be met before dropping Users (e.g. they can't own any objects). Full Details here.

0

精彩评论

暂无评论...
验证码 换一张
取 消