I am currently granting permissions to a service account on a database. I want to ensure if the granting datareader and datawriter persmissions is the same as my grant command.
Adding service account to datareader and datawriter
EXEC sp_addrolemember N'DB_DATAREADER', N'INT\svc-w-corerefdata-de'; EXEC sp_addrolemember N'DB_DATAWRITER', N'INT\svc-w-corerefdata-de';
Creating a role , granting permissions to it and adding the service account to the role.
IF DATABASE_PRINCIPAL_ID('AlterPermCoreRefData') IS NULL BEGIN CREATE ROLE [AlterPermCoreRefData] AUTHORIZATION [dbo] END GRANT EXECUTE, ALTER, SELECT, DELETE, INSERT, UPDATE ON database::[CoreReferenceStaging] TO [AlterPermCoreRefData] EXEC sp_addrolemember 'AlterPermCoreRefData', 'INT\svc-w-corerefdata-de'