LOGIN creation, after DB is restored on another SQL Server:

  • Hello,

    I have restored a database on a another server and I need to create or associate these users with their LOGINs.

    However, the logins do not exists.

    How can I programmatically / TSQL recreate the LOGINs?

    thx

    JohnE

    Cheers,
    John Esraelo

  • There are quite a few good scripts here on SSC for scripting out logins ... I haven't used it, but this looks like it should help: http://www.sqlservercentral.com/scripts/Replication/31160/

    If not, just search the scripts section for "script logins", quite a few to choose from.

    After you move the logins, you'll need to correct the database user to login mapping. Use sp_change_users_login to accomplish that.

  • thank you for the reply.

    I will give it a shot on Monday, thx.

    JohnE

    Cheers,
    John Esraelo

  • sp_help_revlogin is a script that can create a script for logins from the old server.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply