db server crashed

  • I have the backups to restore to another server but I don't have the login scripts.

    So, I'm going to have a problem because of the SID. Any help would be greatly appreciated.

  • A little more information would help, but I think what you're looking for is this:

    sp_change_users_login

    It's deprecated, but useful. That link is to Books Online, it shows examples but says to use 'ALTER USER'. This should get you started.

    ----------------------------------------------------------------------------
    Sacramento SQL Server users group - http://sac.sqlpass.org
    Follow me on Twitter - @SQLDCH
    ----------------------------------------------------------------------------

    Yeah, well...The Dude abides.
  • Thanks, what I mean is that normally when I move a database from one server to another I script out the logins. then I run the script after restoring the database.

  • Gotcha...so that link I provided should help. You'll need to run the commands per user, per database.

    Unfortunately, this doesn't help with any role membership on the instance. If you're not restoring the system databases, you need to recreate those roles from memory.

    ----------------------------------------------------------------------------
    Sacramento SQL Server users group - http://sac.sqlpass.org
    Follow me on Twitter - @SQLDCH
    ----------------------------------------------------------------------------

    Yeah, well...The Dude abides.

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

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