Stored procedures retain the default database that was in effect when they were created. They do not reflect the default database in effect for the session in which they are called unless it is the same as the database in effect when the procedure was created.