Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Created December 7, 2022 18:31
Show Gist options
  • Select an option

  • Save JosiahSiegel/de3898f8e5c4ff6c6e5f8c368d1a5ed9 to your computer and use it in GitHub Desktop.

Select an option

Save JosiahSiegel/de3898f8e5c4ff6c6e5f8c368d1a5ed9 to your computer and use it in GitHub Desktop.
SQL Server Role - Read Write All Databases
USE [master]
CREATE SERVER ROLE [rw_all] AUTHORIZATION [sa]
ALTER SERVER ROLE [bulkadmin] ADD MEMBER [rw_all]
GRANT ALTER ANY DATABASE TO [rw_all]
GRANT CONNECT ANY DATABASE TO [rw_all]
GRANT CONNECT SQL TO [rw_all]
GRANT VIEW ANY DATABASE TO [rw_all]
GRANT VIEW ANY DEFINITION TO [rw_all]
GRANT VIEW SERVER STATE TO [rw_all]
GRANT SELECT ALL USER SECURABLES to [rw_all];
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment