I have a script that creates a login in SQL Server as follows:
CREATE LOGIN [MyDomain\MyUser] FROM WINDOWS WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english]
GO
Is it possible to add to this script the granting of server roles? I want to grant the sysadmin server role to this user
By using sp_addsvrrolemember stored procedure: