Create a Second Subscription
After the second Publication is created, you must create a subscription to the Publication by completing the following steps:
-
On the Publisher SQL Server, execute the following script in the context of the Publication database to create the subscription.
Change the values of the following parameters appropriately:
-
@publication – Name of the second Publication specified while creating the second Publication
-
@subscriber – Name of the SQL Server instance where the subscription database is located
-
@destination_db – Name of the subscription database
-
@subscriber_db – Name of the subscription database
-- MAKE SURE TO EXECUTE THIS ON THE PUBLISHER DATABASE EXEC sp_addsubscription @publication = 'Name of the second Publication' --<< Change here ,@subscriber = 'Subscriber Server name' --<< Change here ,@destination_db = 'Subscriber Database name' --<< Change here ,@sync_type = 'automatic' ,@subscription_type = 'push' GO EXEC sp_addpushsubscription_agent @publication = 'Name of the second Publication' --<< Change here ,@subscriber = 'Subscriber Server name' --<< Change here ,@subscriber_db = 'Subscriber Database name' --<< Change here ,@subscriber_security_mode = 1 ,@frequency_type = 64, @frequency_interval = 0 ,@frequency_relative_interval = 0, @frequency_subday = 0 ,@frequency_subday_interval = 0 GO EXEC sys.sp_startpublication_snapshot @publication = 'Name of the second Publication' --<< Change here GO /* Example: EXEC sp_addsubscription @sync_type = 'automatic' ,@publication = 'CVUE_DEMO_PUB_NewArticles' ,@subscriber = 'CVUESQLSUB\INST1' ,@destination_db = 'CVUE_DEMO_SUB' ,@subscription_type = 'push' GO EXEC sp_addpushsubscription_agent @publication = 'CVUE_DEMO_PUB_NewArticles' ,@subscriber = 'CVUESQLSUB\INST1' ,@subscriber_db = 'CVUE_DEMO_SUB' ,@subscriber_security_mode = 1 ,@frequency_type = 64, @frequency_interval = 0 ,@frequency_relative_interval = 0, @frequency_subday = 0 ,@frequency_subday_interval = 0 GO EXEC sys.sp_startpublication_snapshot @publication = 'CVUE_DEMO_PUB_NewArticles' GO */ -