Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a shot in the dark, so forgive me if it just wastes your time.</p> <p>Another poster mentioned that a given user has an id for the system and an id for any given database. This can be proven out by comparing sid's between the master.sys.syslogins and dbname.sys.users for the same login / user name. If you restore a backup from another sql server that has it's own copy of the master databases, the sids won't match.</p> <p>Sql Server 2005 doesn't allow direct editing of system tables with out a lot of pain. To help out with these mis matches, they added a stored procedure to help you fix them:</p> <p>USE dbName GO</p> <p>sp_change_users_login @Action='Report'</p> <p>That will show you what users have a dbName.sys.users entry, but no master.sys.syslogins one - or where the name exists in both, but differ by sids.</p> <p>If it shows that your user is out of synch, the procedure also has a mode to change the linking:</p> <p>USE dbName GO sp_change_users_login 'Update_One', 'userNameInDbUsers', 'UserNameInLogins' </p> <p>If the sid mis-match isn't your problem, I've also seen really screwy stuff with Sql Server 2005. The gui is especially buggy. To fix a problem like this, I had to actually drop the syslogins entry (via the gui or DROP LOGIN command )</p> <p>sp_change_users_login: <a href="http://msdn.microsoft.com/en-us/library/ms174378(SQL.90).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms174378(SQL.90).aspx</a></p> <p>Drop Login syntax: <a href="http://msdn.microsoft.com/en-us/library/ms188012(SQL.90).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms188012(SQL.90).aspx</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload