Its always good to know how to enter in a locked database. If you have local admin access to the server this procedure might be useful. I decided to reblog this instead of writing a new post and linking to the original because it already is as simple as it gets. Cya!
It embarrasses me to say that this happened again recently. We were building a new SQL Server 2005 server & locked it down before we had added our Administrator group & privileges to the server.
In the old days, I had assumed that I needed to reinstall SQL Server again from scratch … but I haved learned better since then! Since it has happened again, I decided it was worth blogging.
a) Start by granting a user account temporary local windows administrator privileges
b) Stop and restart the SQL Service, through the Services management console , using the -m (or -f) option. This places SQL in single user mode.
c) Log into SQL from the command line (using the account in (a) above)
C:\>OSQL -Sservername\instance -E
d) Create a login for the Windows group
1>CREATE LOGIN [<domainName>\<win_group>] FROM WINDOWS;
e) Give SysAdmin privilege
1>EXEC master..sp_addsrvrolemember @loginame =…
View original post 112 more words