Im trying to modify the list of users what I want to use when "re-mapping" users to logins after a DB restore. I only care about users and their logins that WE have created, not system level accounts just as 'NT AUTHORITY\SYSTEM' , SA, Sys etc...
So I am starting with this list I get
SELECT u.name ,u.uid FROM sys.syslogins l INNER JOIN sys.sysusers u ON l.loginname = u.name;However, in the list that results, I dont see the users that obviously exist in the database AND have a login with a matching name.
For example, there is a user "SALESUSER" as a user in the DB, and has a login, but its not returned in the above query.
Why?