Tuesday, 23 September 2014

SQL SERVER – Add Any User to SysAdmin Role – Add Users to System Roles

SQL SERVER – Add Any User to SysAdmin Role – Add Users to System Roles

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.
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=OFFCHECK_POLICY=OFFGOEXEC master..sp_addsrvrolemember @loginame N'test'@rolename =N'sysadmin'GO
Method 2:  SQL Server Management Studio
Reference : Pinal Dave (http://blog.SQLAuthority.com)

No comments:

Post a Comment