none
Contained databases with VM Machine users RRS feed

  • Question

  • Hi Expert I am configuring contained databases for some application on Alwsyson 2016 Sp2 EE edition .

    Application itself create databases (normal) databases and collation is different to instance collation. After installed I can see application connected to  the db using  "mechine ad user" ex: TEST\VIVIDPRI01$  ending wih "$" sign. That mean there is no actual AD user.  I can see TEST\VIVIDPRI01under the SQL Server login . But those users are represented as  a VM machine. we have servers ex VIVIDPRI0     Now its working fine and all good. 

    Now I need to to convert existing 3 databases  to contained  databases (isolated from other DBs) 

    to have contained database in theory, must  be  in  database user with the password. Instance users will not be considered as a user to access the contained DB. In this situation Application there is no place to enter username/password to connect to DB.

    I dont know how to achieve this with contained databases as its not proper way to have "mechine user " in contained databases with no password. Any expert idea would be greatly appreciated . Cheers    

     
    Wednesday, October 2, 2019 11:21 PM

All replies

  • Hi ashwan,

     

    >>to have contained database in theory, must  be  in  database user with the password. Instance users will not be considered as a user to access the contained DB. In this situation Application there is no place to enter username/password to connect to DB.

     

    You can create sql users (with passwords) or windows users (without passwords) in the contained databases, depending on your needs. The contained database user is independent of the login account, you need to specify the contained database you want to connect to  when you connect to sql server. For example, add -d your contained database to the connection string.

     

     

     

    Best regards,

    Dedmon Dai


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 3, 2019 7:38 AM