Select to view content in your preferred language

Mass GRANT SELECT

1430
6
01-16-2023 01:30 PM
Labels (1)
Laura
by MVP Regular Contributor
MVP Regular 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 | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
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 MVP Regular Contributor
MVP Regular 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 MVP Regular Contributor
MVP Regular 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