Enabling Subscription

  • Is there a way to programatically enable a subscription. I want a SQL statement that will enable a certain subscription. I know Enterprise Mgr. can do it but I need a way to do it with a statement.

  • Remember that everything that EM does, you can do it with T-SQL statements. The best way to know how to programatically enable a subscription is create the subscription with EM, and then script it to see all the stored procedures that are executed.

    Then with BOL you can check all the help for those stored procedure and the parameters.

    If fact, now that I'm used to it, I always use script to anything with replication. If is better to actually understand how replication really works. And also in the stored procedures you have options and features that are not enabled in EM.

  • I'm realatively new to SQL. How would I script the Subscription to see all the stored procedures?

  • With EM, Right Click over Replication, Publications and Generate SQL Script.

    This will ask for a .txt file to save the script. Then open the file and you will see all the stored procedure, command and options, used by SQL to create the Publication you have scripted.

    Also try to check in Books On Line, all the stored procedures that are in the txt file, and read the comments about them. Also check the parameters they use, because some of them may not be used in your publication and might be interesting.

  • Thanks, Racosta. Thats exactly what I needed. I appreciate your help.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply