Drop Login 'XXX' Failed In SQL Server

Pada posting tentang "Drop Login 'XXX' Failed In SQL Server" ini akan dijelaskan bagaimana cara untuk mengatasi problem gagal hapus user di MS SQL Server.

Error :

Login 'XXX' owns one or more database(s). Change the owner of the database(s) before dropping the login.

Check :

select * from (
select name [database], suser_sname(sid) [owner] from master.dbo.sysdatabases
) tmp where owner like '%XXX%'

Fix Problem:

Use [Database Name]
EXEC sp_changedbowner 'sa'

Use [Database Name] DROP USER 'XXX'
GO

Recommended Reading:
Adding Local Database SQL Express For VB.NET


Semoga posting artikel tentang "Drop Login 'XXX' Failed In SQL Server" diatas dapat bermanfaat.



Salam,


Popular posts from this blog

K2 Error Value Cannot Be Null. Parameter Name: s In SmartView and SmartObject

Cara inject USB 3.0 Driver pada instalasi Windows - How to Inject USB 3.0 Driver in Windows 7

Pentaho Spoon Error : "Could Not Create The Java Virtual Machine"