I installed SQL Server, I deleted my windows user account, now I'm trying to access SQL Server using administrator account but it could not connect. It throws error like this
The database TEST is not accessible. (ObjectExplorer)
I installed SQL Server, I deleted my windows user account, now I'm trying to access SQL Server using administrator account but it could not connect. It throws error like this
The database TEST is not accessible. (ObjectExplorer)
Only sysadmins can manage the instance and by default Administrators are not members of the sysadmin role.
You need to restart your instance in single user mode. Here is an article on Technet that describes how to do it: Connect to SQL Server When System Administrators Are Locked Out
Basically it boils down to "restart the instance with the -m switch"
Another way to achieve the same is described in this scary post by Argenis Fernandez. In this case, he impersonates the service SID of the SQL Server instance in order to gain access as a sysadmin and add his user name back to the syadmin role.