• ananda.murugesan (12/6/2012)


    yes..Thanks

    user apperaing in secondary instance database by atuomatically during restore log shipping process..But it won't connect the application due to login is not apperaing under security->Login, Does we need to create login mannually?

    Yes, you can either use the stored procedure

    sp_help_revlogin

    Alternatively, you could use this to generate a create login statement from the primary server for a single login 😉

    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 sys.sql_logins

    where name = 'yoursqllogin'

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

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