SQL Server 2005 Database , we can set each user's corresponding permissions to improve the security of the database. This type of user rights setting is widely used. For example, to set a user access to a table permissions, or even crud permissions, the smaller the granularity can go to a few fields access rights and so on. In fact, this setup process is very simple, then let us learn together.
First, the Operation procedure
1. First enter database-level security-Login name-New Login
(Figure 1: New login name)
2. In the General tab, create a login name as shown, and set the default database.
(Figure 2: Setting options)
3. In the User Mappings tab, as shown in, tick the database you need to set up, and set the "Schema", click "Confirm" button to complete the creation of the user's action
(Figure 3: Select the corresponding database)
4. Now we can set permissions on the user table in the Testlog database, "table"-"Properties"
(Figure 4: Select the corresponding table)
5. In the "Permissions" tab, as shown, click "Add"-"Browse"-"Select Object"
(Figure 5: Set the user to access the table)
6. After clicking on "Confirm" above, we can find the corresponding permission in the list below, if you want to refine the permissions of the column, there is a "column permission" button in the lower right corner to set, click "Confirm" button to complete the settings of these permissions
(Figure 6: List of permissions)
7. Now use the TestUser user login database, after landing as shown, now only see a table
(Figure 7: effects)
Second, the matters needing attention
1. In the 3rd step above, it is important to note that if the corresponding database is not selected, then the testuser will not be found in the Testlog database.
(Figure 8: TestUser user not found)
2. In the 3rd step above, after setting up the Testlog data, you need to click "Confirm" button to complete the creation of user action, if this time to set "security object", is unable to "add"-"specific Object"-"Object Type"-"Login"-"Browse" The newly created TestUser user is found in the.
3. In fact, the user created at the database level "security" is a global one, and when a database is set up, such as Testlog, the user appears in the security list of the database. If you delete testlog This user, you will receive the following prompt. Once deleted, the user will not be able to log in. Need to go to the corresponding database to delete the user, if not deleted and created, will be an error.
(Figure 9: Delete testuser user)
4. In the "Explicit Permissions" list in step 6th, if you select the "Control" option, setting the Query "column permissions" in the "select" is meaningless and the query is not restricted. If you set "column Permissions", the error message will be displayed under normal circumstances:
(Figure 10: effects)
5. In the Testlog database "security"-"TestUser"-"Properties"-"securable"-"Add"-"Object type" Here are more about the database level of some object types can be set.
(Figure 11: Other object types)
About the SQL Server 2005 database user rights setting is described here, and the article here is useful if you want to learn more about SQL Server databases: http://database.51cto.com/sqlserver/, don't miss it!