locked
Error - sp_migrate_user_to_contained cannot be used to copy a password to an old hash algorithm. RRS feed

  • Question

  • Hi,

    I am using SQL Server 2012 and using contained database features.

    I need to take db backup from SQL Server 2008 and restore on SQL Server 2012 and i have to use contained database features.

    But when i am running below query to migrate login to contained then getting error ---

    sp_migrate_user_to_contained
    @username = N'Login_Name',
    @rename = N'keep_name',
    @disablelogin = N'disable_login' ;

    Getting following error -

    Msg 12822, Level 16, State 1, Procedure sp_migrate_user_to_contained, Line 1
    sp_migrate_user_to_contained cannot be used to copy a password to an old hash algorithm.


    Mark As Answer If My Reply Is Helpful<br/> Thanks<br/> Neeraj Bhandari (MCTS - Sql Server 2008)

    Wednesday, June 11, 2014 8:35 AM

All replies

  • I need to take db backup from SQL Server 2008 and restore on SQL Server 2012


    After Migration you have to change the compatibility Level from 10 (= 2008) to 11 (= 2012), otherwise the older hash algorithm of 2008 will be used; and this don't work for contained databases in SQL Server 2012.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Wednesday, June 11, 2014 8:45 AM
  • Hi,

    Already compatibility Level is set to 11 ,  but not working.


    Mark As Answer If My Reply Is Helpful<br/> Thanks<br/> Neeraj Bhandari (MCTS - Sql Server 2008)

    Wednesday, June 11, 2014 1:20 PM
  • After Migration you have to change the compatibility Level from 10 (= 2008) to 11 (= 2012), otherwise the older hash algorithm of 2008 will be used; and this don't work for contained databases in SQL Server 2012.

    This is not a topic I have explored, but first of all you must talking about the compat level of master, aren't you?

    Next, is it really sufficient to change the compatibility level? Wouldn't you also have to set the password after having changed the compat level? I can't see that chaning the compat level would change all password hashes?

    But as I said, I have not researched this, so I am only speculating.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Wednesday, June 11, 2014 9:49 PM