how to prevent dropping sysadmin user by another user in sql server I have a legacy application installed on my server which has configured to work only with one user "sa" and there is time bomb like script written inside this application which whenever it finds another user it will delete that user without any hassle.

We need to have access to database with another application and password of "sa" is lost so the only way remaining is to create another user with sysadmin privileges.

but since the script deletes all the users I can't do anything special, so my question is :

How can I prevent that script or rollback its job every time it is trying to delete my user?
CREATE TRIGGER [DDL_PreventLoginDrop]ON ALL SERVER 
FOR DROP_LOGIN
AS 
DECLARE @LoginName NVARCHAR(128),@eventData XML

SET @eventData = EVENTDATA()            
SELECT @LoginName=@eventData.value('data(/EVENT_INSTANCE/ObjectName)[1]', 'SYSNAME')
IF @LoginName IN ('Login name that you want to protect')
  BEGIN
    PRINT 'Gotha, you nasty application!' 
    ROLLBACK;
  END
GO
ENABLE TRIGGER [DDL_PreventLoginDrop] ON ALL SERVER 


disclaimer:
Hopefully you'll agree that this answers your question "How to prevent dropping a login" but in no way is this a proper root cause fix. However, I know that there are some pretty nasty legacy applications where it's not possible to change the code... I must admit, this one just made me smile..