Mass GRANT SELECT

250
6
01-16-2023 01:30 PM
Labels (1)
Laura
by
Occasional Contributor

Looking how to grant select on a whole database or owned schema at once. Don't really want to do it individually for thousands of layers.

I tried GRANT SELECT ON SCHEMA :: "schema" TO "user" and got an error

Tags (3)
0 Kudos
6 Replies
Asrujit_SenGupta
MVP Regular Contributor

Check the Datareader role in SQL Server.

An overview of the db_datareader role 

Database-level roles 

0 Kudos
MarceloMarques
Esri Regular Contributor

See this documentation that I wrote
https://desktop.arcgis.com/en/arcmap/latest/extensions/production-mapping-guide/admin-pm-sql-server/...

Read my database guide books best practices and download my database template scripts, see link below.

https://community.esri.com/t5/mapping-and-charting-enterprise-databases/mapping-and-charting-solutio...

| Marcelo Marques | Principal Product Engineer | Esri |
| OCP - Oracle Certified Professional |
0 Kudos
ShannonShields
Esri Contributor

did you get an error executing the grant statement in Management Studio, or did you get a specific error when the user tried to access the data on the schema you granted to?

0 Kudos
Laura
by
Occasional Contributor

Management Studio

0 Kudos
ShannonShields
Esri Contributor

what was the error? Are you using double-quotes around the schema & user name, and if so try dropping them.

0 Kudos
Laura
by
Occasional Contributor

I've started just granting privileges through the group layer in Pro to avoid the error. But it takes abut 10 minutes or so to do a group layer due to loading. 

0 Kudos