Hi @rr-4098,
Do you mean how to change the exiting database into contained database? I did the test below:
- This is my database named aaa:
Please don't forget change it into partial:
- Create a new login with password:
create login TestC with password='test' - Create a new user for the new login:
use aaa Create user LUCY FOR login TestC with Default_schema=[dbo] - You can check it:
select * from master.sys.server_principals where name = 'TestC'select * from aaa.sys.database_principals where name= 'LUCY' - Change into contained database:
Use aaa GO sp_migrate_user_to_contained @username = N'LUCY', @rename = N'keep_name', @disablelogin = N'do_not_disable_login'; - Use SSMS to connect: You can enter the database name manually!!!
-