Setup Steps
- Enter SQL Server Management Studio(MSSQL client)
- Select Security , login name , right-click New Login
- Enter user name and password in general
- In user mappings , "users mapped to this login" Select a database that the user can manipulate
- Select "db_datareader" in "Database role membership",
- Such a read-only user is created.
Server role Reference (table structure modifications can be made to the database)
role name |
functional Description |
bulkadmin | td> can run BULK INSERT statement bulk insert verbose http://blog.csdn.net/jackmacro/article/details/5959321
dbcreator |
Create, modify, delete, restore any database |
diskadmin |
managing disk files |
processadmin |
to terminate a program running in an instance of the database engine |
securityadmin |
can manage logins and their properties, have Grant,deny, and revoke server and database-level permissions, and can reset SQL Server Password for login |
serveradmin |
can change server-wide configuration options and shut down the server |
setupadmin |
can add and remove linked servers and execute stored procedures on certain systems that can be executed (e.g., sp_serveroption) |
SysAdmin |
any activity in SQL Server that feels that the permissions span all other fixed server roles, by default, the Windows Builtin\admin Group (local Administrators group) is a member of the sysadmin fixed server role |
User Mapping Reference (can operate on database data)
Role name |
Function description |
db_owner |
Users who can perform all the technical actions in the database |
Db_accessadmin |
Users who can add, delete users |
Db_datareader |
Users who can view data from user tables in all databases |
Db_datawrite |
Users who can add, modify, and delete data in all database user tables |
db_ddladmin |
Users who can perform DDL operations in the database, creation of DDL (Data Definition Language) tables, and management |
Db_securityadmin |
Users who can manage all actions related to security permissions in the database |
Db_backoperator |
Users who can back up the database (you can publish DBCC and CHECKPOINT statements, which are typically used before a backup |
Db_denydatareader |
Users who cannot see any data in the database |
Db_denydatawrite |
Users who cannot modify any data in the database |
How to create a read-only account in SQL Server