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

No comments:

Post a Comment

Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists

If you received below error while attaching a .mdf file in cluster environment please follow below steps to resolve the issue ERROR Ca...