The preferred interface for managing replication is the graphical interfaces provided in SQL Server Management Studio in the various replication wizards. However, many DBAs will want to be able to create a script that can be checked into a source code control system such as Visual Source Safe or Visual Studio Team Foundation Server.
To script replication, you have two options. You can use either the various replication wizards, which provide a scripting option, or SQL Server Management Studio and script individual objects.
The scripts can be saved into your source code control system, where they can be version controlled and used to deploy a replication configuration to development, test, QA, pre-production, and production systems. See Chapter 10 for more information on using Visual Studio Team Server Database Edition (VSTS DB Pro) and Team Server Source Control (TSSC).