Refactoring database after migrating table I'm creating a new staging database, into which I intend to migrate several tables from the old database. These tables are referenced in functions and stored procedures. If I were doing things manually, I would just migrate the tables, and then modify the functions by replacing the old table name with the new table name. I'm thinking there must be a more automated way of doing this though.

Has anyone done something similar; what tools have you used to help refactor?
Replace the tables in the old database with synonyms that point to the location in the new database.

This not only minimizes the code change, it gives you a single place to manage the references to objects in other databases.