1

Is there an easy way to grant any authenticated user (everyone) access (read) to a given database?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Bjørn H. Sandvik
  • 533
  • 4
  • 10
  • 22
  • simple way is EXEC sp_addrolemember N'db_owner', N'USerNAme' but here username is required , if need all user at a time then make a sp which executed auto with new db user creation – Nazir Ullah Jun 11 '16 at 23:24
  • I don't think there is an easy way. Have a look at: http://stackoverflow.com/questions/6688880/how-do-i-grant-read-access-for-a-user-to-a-database-in-sql-server – Alex Jun 12 '16 at 02:41

1 Answers1

3

One method is to enable the guest user and add it to the db_datareader fixed database role:

USE YourDatabase;
CREATE USER guest;
ALTER ROLE db_dataReader ADD MEMBER guest;
Dan Guzman
  • 43,250
  • 3
  • 46
  • 71