How do I create multiple users with one login to have access to single database [closed]

Posted on

Question :

What is the benefit of creating a login for users?

If a login grants the principal entry into the server, I want to grant this login to three users:

  1. db-writer
  2. db-reader
  3. ddl-admin

each with different privileges.

How do I do this?

Answer :

I think you actually confuse logins and database users as Thronk said.
One login can be associated with many users but only in different databases.
As Thronk said, it’s a 1:1 relationship between a SQL Server login and a database user.

You should use multiple logins mapped to different database users in your university database with different permissions as you want.

Another way to do what you want is to use EXECUTE AS and grant impersonate, but you will have to do this programatically.

Leave a Reply

Your email address will not be published. Required fields are marked *