Creating publications and subscriptions

Publications and subscriptions allow you to organize primary and replicate articles in a database. Before you can create an article, you must first create a publication or subscription.

NoteYou must suspend the database connection before you create a publication or subscription. See “Suspending and resuming database connections” for more information.

To create a publication, use sp_addpub:

sp_addpub pub_name, "conn_name"

where pub_name is the name of the new publication, and conn_name is the primary database connection name in the form ds.db.

To create a subscription, use sp_addsub:

sp_addsub sub_name, pub_name, "conn_name"

where sub_name is the name of the new subscription, pub_name is the name of the publication that the new subscription subscribes to, and conn_name is the replicate database connection name in the form ds.db.

Publications are associated with a specific primary database and subscriptions are associated with a specific replicate database. Each database can have more than one publication or subscription associated with it.