How to delete yourself as a Login. E.g. You may want to do this when the hostname changed so that Sql Server records your Login under the old hosthame.
Login to SSMS. Select the 'sa' account and change the password to something you will remember.
Close down SSMS, start it up again but login as 'sa' this time. Select the Login you wish to delete, right click for Delete.
You will probably be told that Login owns one or more databases.
Login 'hostname\The Login' owns one or more database(s).
Change the owner of the databases before dropping the logon. [MS Sql Server Error 15174]
To list the owner of every database:
select suser_sname(owner_sid) from sys.databases
To change the owner of every database to 'sa'
EXEC sp_MSforeachdb 'EXEC [?]..sp_changedbowner ''sa'' '
<-- This sp_MSforeachdb will probably fail for one or two, as it did for me. In my case because that database was single user. Changing the rogue database to multi-user fixed that. Then I just ran EXEC sp_MSforeachdb ... again.
To check, run
select suser_sname(owner_sid) from sys.databases
again to ensure the Login is gone
Now delete that login.