Replicating a Table Locally

A table can be replicated locally, to another database on the same server. In this example, on the server TERRIER, the pubs..titles table will be replicated to the localdest database.

The following example assumes that the replication topology has been configured following the example in Setting Up A Replication Topology, earlier in this chapter.

    To replicate a table to a local database
  1. Create a database named localdest on TERRIER.

    For this example, this will be used as the destination database. For information on using SQL Enterprise Manager to create a database, see Chapter 6, Managing Databases.

  2. Authorize TERRIER to publish to itself.
  3. Authorize localdest to be a subscription database.
  4. Publish the pubs..authors table.

  5. Subscribe the localdest database to the allauthors publication.

This replication example is now set up. If the default synchronization setting for the publication allauthors was not changed, synchronization will occur within five minutes. Synchronization will copy the schema and data from the published tables to the destination database. After that, replication of changes to table data will occur as changes are made.