In order to solve the situation the following steps are needed:
1. Configure the SQL server in single user mode. To do this, open SQL Server Configuration Manager and identify the instance to work with.
2. From the SQL Server Configuration Manager, stop the desired SQL Server Instance
3. In the SQL Server Configuration Manageropen the properties of the desired SQL Server Instance by choosing them from the mouse right-click context and navigate to the Advanced tab.
4. Identify the Startup parameter and open it. Add
-m"sqlcmd.exe";
at the beginning of the line. This will allow only sqlcmd.exe to connect to the SQL instance (thus blocking other applications that may otherwise take over the single user SQL instance).
5. Start the SQL instance
6. On the SQL server, open an elevated command prompt.
7. Run
sqlcmd.exe -S .\instancename
Please note that the "-S" parameter needs to be capital letter
8. Run a Transact-SQL (Below) command to add an existing account or a new account to the sysadmin server role. Replace DOMAIN\Username with the account you want to add or update.
EXEC sp_addsrvrolemember 'DOMAIN\Username', 'sysadmin';
GO
9. Reconfigure the SQL server to multiuser mode (Use SQL Server Configuration Manager to stop instance service, navigate to properties, Advanced, remove the '-m"sqlcmd.exe";' string from the Startup parameter and restart the service).
10. If the SQL server is in mixed mode, reset the SA password using the Microsoft SQL Server Management Studio, loging in with the account you added, expanding the Security and then logins and finally by opening the properties and reseting the password.
All done!