01.25.05

MSSQL Disembodied Users

Posted in Uncategorized at 10:17 am by UnwashedMeme

When you are backing up and restoring databases from one Micrsoft SQL Server to another, it is not uncommon to end up with a user on the new server associated with the database but has not login on the server. The way to give the user a login is to:

  1. Open Query Analyzer to the database in question.
  2. SELECT * FROM sysusers
  3. Find the user in question from the list.
  4. EXEC sp_addlogin 'Username', 'password', 'defaultDatabase', 'us_english', 0x0123456789ABCDEF0123456789ABCDEF
    • The last parameter is the sid of the user found in steps 2-3

It works for me at least.

Leave a Comment