The reason I like blogging is follow up questions. I have wrote following two articles earlier this week. I just received question based on both of them. Before I go on questions, I recommend to read both of the article first. Both of them are very small article so they are quick to read.
SQL SERVER – Fix : Error : Msg 15151, Level 16, State 1, Line 2 Cannot alter the login ’sa’, because it does not exist or you do not have permission
The question I had received is following: “How to add any user to systemadmin role?“
This is very simple process.
Method 1: T-SQL
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
Method 2: SQL Server Management Studio
Reference : Pinal Dave (https://blog.sqlauthority.com)