sql server books online
under 'contents' there is a whole chapter on replication
How to Configure Publishing and Distribution (Transact-SQL)
Execute sp_adddistributor at the server that will be the Distributor.
Execute sp_adddistributiondb at the Distributor to create a new
distribution database.
Execute sp_adddistpublisher at each server that will be a Publisher
using the Distributor.
On the master database on the Publisher, execute sp_replicationdboption
for each database that will be a publication database.
How to Modify Publisher and Distributor Properties (Transact-SQL)
To view Distributor properties
Execute sp_helpdistributor to list information about the Distributor,
distribution database, working directory, and SQL Server Agent user
account.
Execute sp_helpdistributiondb to return properties of the specified
distribution database.
To modify a Distributor
Execute sp_changedistributor_property to modify Distributor properties.
Execute sp_changedistributiondb to modify distribution database
properties.
To add a password to a Distributor
Execute sp_add_distributor specifying the password parameter.
To change a password on a Distributor
Execute sp_changedistributor_password.
To create a new distribution database
Execute sp_adddistributiondb to create a new distribution database and
install the distribution schema.
To add a Publisher to a distribution database
Execute sp_adddistpublisher n times to define each Publisher that uses
the Distributor.
To remove a Publisher from a distribution database
Execute sp_dropdistpublisher to drop a Publisher that is also the
Distributor.