Methods for implementing replication, developing replication applications, and maintaining replication are: replication wizards and properties, replication programming interfaces, scripting of system stored procedures, and Windows Synchronization Manager.
SQL Server Enterprise Manager includes several wizards and properties dialog boxes you can use to simplify the installation and maintenance of replication. SQL Server Enterprise Manager allows you to view and modify the properties of replication, and provides graphical navigational tools. It also provides the replication folder and Replication Monitor, which help you monitor and troubleshoot replication activity.
The following replication wizards and properties dialog boxes provide a guided approach to implementing replication:
After replication is configured using wizards, you can script different configuration processes of replication. For example, after creating a standard subscription to a publication for one Subscriber, you can script the set up of the subscription, run it at various Subscribers, and substitute the correct Subscriber name in the script as necessary. For more information, see Scripting Replication.
Another method of replication implementation and administration is by using one of, or a combination of, the replication programming interfaces:
SQL-DMO has more options available than the replication wizards (which are based on SQL-DMO), and you can create custom applications using Microsoft Visual Basic® or Microsoft Visual C++® that allow you to configure or maintain a replication topology. SQL-DMO can be used to program replication administration such as configuring distribution, creating subscriptions, and so on.
ActiveX controls for replication enable you to control Snapshot Agent, Merge Agent, and Distribution Agent activity programmatically. This allows users to program replication into their applications. The controls also offer some lightweight administration options to create, delete, and reinitialize subscriptions, and to control, monitor, and troubleshoot replication agents. These controls can be used to program activity needed to operate replication. For example, for an application that provides online and offline capabilities, you may want to expose a Synchronize button. That button can be associated with the merge ActiveX control, and whenever the users click the button, the Merge Agent connects to the Publisher, and data is synchronized for the specified publication.
The Replication Distributor Interface provides the capability to replicate data from heterogeneous data sources such as Microsoft Access or Oracle. The Replication Distributor Interface is used primarily by independent service vendors, or others who need to develop a custom replication application based on proprietary data sources.
Essentially, this interface allows a custom solution while employing the replication distribution system, but developers assume the data modification detection capabilities that would typically be conducted by the Log Reader Agent.
Replication system stored procedures are documented and available as a method for implementing replication in special circumstances or for use in batch files and scripts. In most cases, however, you are better served by using the programming interfaces SQL-DMO and replication ActiveX controls for programming replication. SQL-DMO provides an easier method and higher-level solution than direct use of stored procedures.
The stored procedures are typically used if you use the scripting features from SQL Server Enterprise Manager. When you script replication, SQL Server generates Transact-SQL batches that re-create the replication environment (configuring publishing and distribution, creating publications and subscriptions, and so on). After the scripts are generated, you can edit them as needed using SQL Query Analyzer.
Windows Synchronization Manager is a utility available with the Microsoft Windows® 2000 operating system and anywhere Microsoft Internet Explorer version 5.0 or later is installed. It allows you to synchronize data between instances of Microsoft SQL Server™. You can use SQL Server Enterprise Manager to enable pull subscriptions for use in Windows Synchronization Manager, or you can enable subscriptions programmatically for use in Windows Synchronization Manager by using ActiveX controls for replication.
Using Windows Synchronization Manager, you can schedule synchronizations or instruct Windows to synchronize selected items automatically when you log on to the computer or when the computer is idle for a specified length of time. Windows Synchronization Manager is located under the Accessories folder on the Windows Start menu.
Developing SQL-DMO Applications