I need a scheduled job, or a stored proc, or something, that can run against two databases at once. Is this possible?
I've currently got two databases that are nearly identical in structure. They both run online forums. Each of them runs a SP as a scheduled job step every ten minutes. Both SP's check the same Outlook mailbox (a restriction of SQL Mail), for messages relating to that forum, and processes them if necessary. They check whether a message relates to "their" forum/database by comparing the email's "from" address against the email addresses in the "forum_users" table.
The problem is with spam and other miscellany that neither of the databases decide is for them. I can't make the SP's run on a "if it's not for me, delete it" basis, because what if it's for the other database?
So I need a "cleaning" SP - one that will run through and compare the email "from" address against the email addresses in BOTH databases - and then delete anything that doesn't match.