Home Forums SQL Server 2008 SQL Server 2008 High Availability Dear All this post is about logshipping DC- DR Drill [switch over and switch back (or)failover and failback ] RE: Dear All this post is about logshipping DC- DR Drill [switch over and switch back (or)failover and failback ]

  • I agree with Robert, avoid re mapping unless necessary. Create the login with the correct SID, this script is also useful for generating CREATE LOGIN ... statements from a source server. The roles should be pretty easy for you to figure out 😉

    SELECT'CREATE LOGIN ' + name + ' WITH PASSWORD = ' +

    sys.fn_varbintohexstr(password_hash) +

    ' HASHED, SID = ' + sys.fn_varbintohexstr(sid) +

    ', DEFAULT_DATABASE = ' + QUOTENAME(default_database_name) +

    ', DEFAULT_LANGUAGE = ' + default_language_name +

    ', CHECK_EXPIRATION = ' +

    CASE

    WHEN is_expiration_checked = 0 THEN 'off'

    ELSE 'on'

    END +

    ', CHECK_POLICY = ' +

    CASE

    WHEN is_policy_checked = 0 THEN 'off'

    ELSE 'on'

    END

    FROM master.sys.sql_logins

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉