Database objects, having interdependent relationships, are transferred for
replication from a publisher to a subscriber in the order of a
topological sort using a depth first search algorithm. When the depth
first search algorithm attempts to enumerate all outgoing edges
(dependencies) of a given node (database object), a request is made to
begin an atomic transaction and then a temporary copy (e.g., via a T-SQL
command) of the node/database object is created under a different name.
The temporary copy is used to store dependency information that could
otherwise be impaired by the replication process. Dependencies amongst
database objects are thus preserved during the replication process
through use of the temporary copy, as well as by transferring the
database objects according to the topological sort order.