@echo off
set service=MSSQL$SQLEXPRESS
net stop %service%
net start %service% /mSQLCMD
sqlcmd -S (local)\sqlexpress -Q "EXEC master..sp_addsrvrolemember @loginame = N'DOMAIN\username', @rolename =N'sysadmin'"
net stop %service%
net start %service%
Wednesday, September 4, 2013
SQL Server Express: Batch file to give user sysadmin rights
sysadmin.bat
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment