After installing SQL server on a machine, it happens that you connect or disconnect that machine to domain. WHen you do this, the administrator account can no longer access the database engine. The below steps allow you to regain access to the SQL server...
ms sql server 2008 R2, It sows me login window on execution of Alter query, Can you me- ZAHID
Stupid! doesn't work on SQL Server 2008 +
Its working on SQL Server 2008 R2
Small update on step 1 and 3
Run as administrator both command line and SQL Server Management Studio