quinta-feira, 5 de novembro de 2015

Enabling public role database for use (at your own risk)

Why a recently created login cannot connect to a database if every login/user is by default associated to the public role? Because that role is not configured to gain automatic access to the database!
That's how you enable it: On the Database which you can grant public access right click it and choose permissions. Search for the public database role and add it to the list of users. Grant Connect and Select to it on the list of permissions. Click OK.
Every new login created will gain access automatically for connect and select every securable object of that database. Additional permissions must be granted for each user according to his/her security rights. Do this for each database you want to enable to use the public database role.
Advice: Do not do that if you have any doubt about the risks involved. Don't grant any other privileges than connect and select. It's meant to test and learning only. As someone said before, database it's not child's play.