I'm not sure I follow 100%, but at the very least, you'll need a linked server and to fully qualify your table names in your sql statements. Even the EXEC statement on msdb will need fully qualified with the linked server name. I'm not sure this will work, but it's worth a try on your end.