Thursday, April 30, 2015

CREATE LOGIN of windows user and GRANT SYSADMIN Access

Using below command you can create a windows login and grant SysAdmin access. Replace DOMAIN\LOGIN with windows login name 


USE [master]
GO
CREATE LOGIN [DOMAIN\LOGIN] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
EXEC master..sp_addsrvrolemember @loginame = N'DOMAIN\LOGIN', @rolename = N'sysadmin'
GO

--
Thanks & Regards
Venkat Sangu