I'm migrating databases from SQL Server 2012 to Server Server 2017, and switching SOME of them to partially contained. I've done SQL Server backups and restores to actually move the databases, and switched them to partially contained. When I then recreate the Windows-based logins at the server/instance level, they are automagically reconnected to the database users - in both the partially contained and non-contained databases. For the users in the partially contained databases, I would like to break the link between the instance-level Windows login and database user, so that the authentication happens at the database level (but it's still a Windows login). I don't want to drop the instance-level Windows login because it is needed for other databases.

sp_migrate_user_to_contained is only for SQL Server logins, not Windows-based logins. I could try one of the scripts out there for cloning a user and basically drop the existing user and recreate it, but I'm hoping not to.

Is what I'm trying to do not really supported, or maybe just pointless?

  • 2
    I don't think you can do this. But why do you want to? – LowlyDBA Nov 1 '18 at 16:31
  • I thought doing this was part of making the database as contained as possible. But I'm beginning to think it doesn't make any difference. – M Herbener Nov 1 '18 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.