You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was automating some work and took some of your DB permissions code to do it. The sp_addrolemember gave me some issues with roles already being assigned. I changed it to the ALTER ROLE and the problem was solved.
Change
SqlCommand addRoleMember = new SqlCommand($"sp_addrolemember 'db_owner', '{appPoolName}'", myConn);
to
SqlCommand addRoleMember = new SqlCommand($"ALTER ROLE [db_owner] ADD MEMBER [{appPoolName}] ", myConn);
The text was updated successfully, but these errors were encountered:
The sp_addrolemember in SQL will be removed in future. You probably know!
https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addrolemember-transact-sql?view=sql-server-ver16
I was automating some work and took some of your DB permissions code to do it. The sp_addrolemember gave me some issues with roles already being assigned. I changed it to the ALTER ROLE and the problem was solved.
Change
to
The text was updated successfully, but these errors were encountered: