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!

DBA By Day, Gamer By Night

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.

MSDN – http://msdn.microsoft.com/en-us/library/dd207004.aspx

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;

2>GO

(MSDN- http://msdn.microsoft.com/en-us/library/ms189751.aspx)

e) Give SysAdmin privilege

1>EXEC master..sp_addsrvrolemember @loginame =…

View original post 112 more words

Advertisements

About mauriciorpp

Hi, I am Piccolo - but not the one from Dragon Ball. I'm from a highly competitive and fast-paced world too, the IT industry, and this space will be used to share some challenges I face daily on my career. As you will see, I don't do brawls but I need to be a fighter! Stay tuned.
This entry was posted in SQLServer, Windows and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s