none
CHANGE THE DOMAIN NAME FOR SQL SERVER LOGIN

    General discussion

  • Summary
    =============================
    How do we rename the integrated login names when the windows domain name has been changed?

    For SQL server 2005 and SQL server 2000
    =======================================================

    FOR SQL SERVER 2005:

    -- Execute the following command in SQL server

    ALTER LOGIN [login name] with name=[new name]

    -- The logins for the users automatically changes to the new login

    For Ex: ALTER LOGIN [AIB\32582] with name=[AD\32582]





    FOR SQL SERVER 2000:

    We followed the below steps

    -- The SP_SIDMAP stored procedure is used if we need to map the users with the existing logins.

       SAMPLE Stored Procedures That Helps Map SIDs Between User and Master Databases When A Database Is Moved: http://support.microsoft.com/kb/298897

    -- This stored procedure would not rename the domain name from the login.

              1) The customer wanted to change the domain name from AIB to AD for the login AIB\<account name>
              2) created a new account with the name AD/<Account Name>
              3) Then ran the stored procedure as below.

                       EXEC sp_SidMap @old_domain = 'AIB',
                       @new_domain = 'AD',
                       @old_server = old_server_name,
                       @new_server = new_server_name
     
              4) check the SID for the AIB\<account name> and AD/<Account Name> and compare with the user in the database.
              5) expected result is that SID of the database user should be equal to AD/<Account Name>. But it didn’t happen.
              6) renamed the database user to AD/<Account Name> and then ran the sp_SidMap stored procedure.
              7) This time the SID was changed as expected.
              8) renamed the database user to the earlier name.




    References
    =============================
    ALTER LOGIN  : http://msdn.microsoft.com/en-us/library/ms189828.aspx
    How to resolve permission issues when you move a database between servers that are running SQL Server: http://support.microsoft.com/?id=240872
    SAMPLE Stored Procedures That Helps Map SIDs Between User and Master Databases When A Database Is Moved: http://support.microsoft.com/kb/298897


    Microsoft Online Community Support
    Wednesday, March 4, 2009 11:27 AM
    Moderator