參考 : SQL SERVER – Add Any User to SysAdmin Role – Add Users to System Roles
方法1 :
<pre class="c" name="code">USE [master]
GO
CREATE LOGIN [test] WITH PASSWORD=N'test', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
EXEC master..sp_addsrvrolemember @loginame = N'test', @rolename = N'sysadmin'
GO
方法2 : 用 SQL Server Management Studio