Hi @Russel Loski ,
Do you backup the file in the production by your own account and use backfile from other account?
Is the account log in production server side has the equivalent permission as the account in the test server side?
I think the root cause is that the account in Production does not have the permission to check the sys.database_principals,sysusers, for example, the log in on the Production side as one public or others which don't have the alter any user permission, and the account log in the test server can act as sysadmin.
Note:
Any user can see their own user name, the system users, and the fixed database roles. To see other users, requires ALTER ANY USER, or a permission on the user. To see user-defined roles, requires ALTER ANY ROLE, or membership in the role.
I can reproduce your issue as next:
Production Server Side:
- Production database backuped by YX\Administrator;
- Use YX\Client login Production, but YX\Client is just one public one, then select from sys.database_principals, YX\Client can only check his own informations
Test Server Side:
YX\Client as sysadmin in Test Server side, then this account restore the backupfile and use the sys.database_principals, this account can see all the information.
BR,
Mia
If the answer is helpful, please click "Accept Answer" and upvote it.