I would like a to produce a new user on the db with just the choose permissions (read only access) how do i do that ? i am dealing with sql 2008
You could include the consumer towards the Database Level Role db_datareader.
People from the db_datareader fixed database role can operate a Choose statement against any table or view within the database.
See Books Online for reference:
You can include a database user to some database role while using following query:
EXEC sp_addrolemember N'db_datareader', N'userName'
You should use Create USer to produce a user
CREATE LOGIN sam WITH PASSWORD = '340$Uuxwp7Mcxo7Khy'; USE AdventureWorks; CREATE USER sam FOR LOGIN sam; GO
and also to Grant (Read-only access) you should use the next
GRANT SELECT TO sam
Hope that can help.
For that GUI minded people, you are able to:
- Right click on the Database in Management Studio.
- Choose Qualities
- Choose Permissions
- In case your user doesn't display in the list, choose Search and kind their title
- Choose the consumer within the Customers or Roles list
- Within the lower window frame, Look into the Choose permission underneath the Grant column