Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out

来源:这里教程网 时间:2026-03-02 10:26:49 作者:
http://msdn.microsoft.com/en-us/library/dd207004%28v=sql.105%29.aspx[@more@]

[run as Admin]

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:Windowssystem32>

C:Windowssystem32>net stop mssqlserver

The SQL Server (MSSQLSERVER) service is stopping.

The SQL Server (MSSQLSERVER) service was stopped successfully.

C:Windowssystem32>net start mssqlserver /m

The SQL Server (MSSQLSERVER) service is starting.

The SQL Server (MSSQLSERVER) service was started successfully.

C:Windowssystem32>sqlcmd

1> EXEC sp_addsrvrolemember 'MSDOMAIN1RT-DBA', 'sysadmin';

2> GO

1> quit

C:Windowssystem32>net stop mssqlserver

The SQL Server (MSSQLSERVER) service is stopping.

The SQL Server (MSSQLSERVER) service was stopped successfully.

C:Windowssystem32>net start mssqlserver

The SQL Server (MSSQLSERVER) service is starting.

The SQL Server (MSSQLSERVER) service was started successfully.

C:Windowssystem32>

相关推荐