DB Instance

Rohit Kulkarni 731 Reputation points
2022-02-04T13:48:26.027+00:00

Hello Team,

I am having 3 DB Instance in azure. I have 1 user and need to access to only 1 instance. How it can be done .Please advise me or let me know any link .

171410-image.png

Thanks in advance

RK

Azure SQL Database
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sreeju Nair 12,666 Reputation points
    2022-02-04T13:58:25.377+00:00

    Yes. You can assign user permissions only to a specific database and this is purely possible. Refer the following link

    https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage#existing-logins-and-user-accounts-after-creating-a-new-database

    0 comments No comments

  2. Alan Kinane 16,951 Reputation points MVP Volunteer Moderator
    2022-02-04T14:03:08.757+00:00

    If this is for Azure SQL then you can create non-admin database users and grant them access to the required databases only.

    This can be done in the traditional manner with T-SQL or else using a management tool like SQL management studio.

    https://learn.microsoft.com/en-us/sql/t-sql/statements/create-login-transact-sql?view=azuresqldb-current&preserve-view=true#examples-1

    https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/create-a-database-user?view=sql-server-ver15

    0 comments No comments

  3. Patrick C 81 Reputation points
    2022-02-04T17:42:44.31+00:00

    You can also create a contained user which will only exist in the desired database ( no logins in the master DB)
    basically you can use a syntax similar to : CREATE USER [YourUserName] WITH PASSWORD = [YourPassword]

    see https://learn.microsoft.com/en-us/sql/t-sql/statements/create-user-transact-sql?view=sql-server-ver15
    and https://learn.microsoft.com/en-us/sql/relational-databases/security/contained-database-users-making-your-database-portable

    171492-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.