SQL Server: Add logins from command prompt


To start SQLSERVER instance in a single user mode and shortens the startup time

SQLSERVR -m–c
 
To add a Windows user to the sysadmin fixed server role in SQL Server 2005 as a failure recovery mechanism

SQLCMD -s computername -E

Exec sp_addsrvrolemember @loginname=’computername\local account’
GO

Finally reboot the machine.


Ref:
- http://msdn.microsoft.com/en-us/library/ms180965(v=sql.105).aspx
- http://support.microsoft.com/kb/937682
- Paul Copley, Sr. DBA

Comments

Popular posts from this blog

Restoring Master, Model and MSDB from Netbackup

Oracle Job Operations