Last night I moved a database from Server Q (QA) to Server P (prod). Part of the process was to remove some QA logins we use and replace them with production logins.
Things seemed to go well but during testing a job running as Login F failed with error 18456. Simple, tt wasn't on the list of logins sent to me to provide access to. We changed the job that runs on a separate server to run under another login and it worked.
Seems simple, but investigating I found that this login F didn't have access to the database in our QA environment either. It was set up as a database user for another database and we have cross database permissions enabled.
Checking Server P (prod), it's set up the same way. So I'm trying to figure out why a job running as this database user worked in one environment but failed in production where the configuration seems to be the same.