For subscriptions that are not anonymous, you must enable the Subscriber so it can receive data from the Publisher, attach the subscription database, and add the subscription at the Publisher using SQL-DMO or stored procedures. You can add the subscription at the Publisher before or after attaching the database.
To enable a Subscriber to receive published data
To attach a subscription database with named subscriptions