Restrict SQL Server Login access to only one database

前端 未结 4 2120
北恋
北恋 2020-12-02 06:21

I have a SQL Server server which has around 50 databases on it.

I wish to create a new Login for a client who wishes to have access to the

4条回答
  •  青春惊慌失措
    2020-12-02 07:09

    this is to topup to what was selected as the correct answer. It has one missing step that when not done, the user will still be able to access the rest of the database. First, do as @DineshDB suggested

      1. Connect to your SQL server instance using management studio
       2. Goto Security -> Logins -> (RIGHT CLICK) New Login
       3. fill in user details
       4. Under User Mapping, select the databases you want the user to be able to access and configure
    

    the missing step is below:

    5. Under user mapping, ensure that "sysadmin" is NOT CHECKED and select "db_owner" as the role for the new user.
    

    And thats it.

提交回复
热议问题