I have migrated a set of SQL 2000 databases to SQL 2008. Most is working well, however I have some stored procedures that scheduled and run by SQL Server Agent jobs that are giving me troubles. Many of the scheduled stored procedures work, but the stored procs that access a database other than the default databases are failing with the following message:
Executed as user: XYZ\YadaYada. The server principal: "XYZ\YadaYada" is not able to access the database "MyOtherDatabaseOnSameServer" under the current security context. [SQL STATE 08004](Error 619) The step failed.
Obviously, I changed the names to protect the guilty.
The account is a user in all of the relavent databases and is a memeber of db_owner, db_datareader, and db_datawriter.
When I run these same procedures from a query window in SMS using the same accounts (I have tried many) they work fine.
What am I missing?