replication scipts before/after snapshot

  • Hello,

    I would like to have information about the scripts before and after applying a snapshot.

    When I do an initial snapshot, scripts are executed but for a "normal" snapshot, they are not!!!

    why?

    thank you.

  • If I understand correctly, you mean the before and after scripts set in a publication.

    I'm not 100% on the difference between a normal and not normal snapshot!

    If you mean the initialisation snapshot and any modification (additonal/change articles) snapshots then what is happening is correct. Before and after scripts are only applied for initialisation of the subscriber.

    What are you trying to achieve?

  • It's exactly what i mean!!

    I want to keep the indexes on the subscriber when I adds a table to a publication.

    So I wrote a script that create all indexes (script before) and i apply it after the snapshot.

    How can I do the same as initial snapshot because when I adds the table to the publication, the table is dropped and create (without the specific indexes of the subscriber)

    thx

  • So you are adding an article to a publication where the object already exists on the subscriber?

    You can change the default action on adding an article to something other than drop.

    sp_addarticle @pre_creation_cmd = none|drop|delete|truncate

    http://msdn.microsoft.com/en-us/library/ms173857.aspx

  • Yes, the object already exists.

    the problem is that someone has accidentally uncheck an article and when it have been recheck we lost indexes.

    So it's why I want to automize the export/import indexes before/after a snapshot to avoid those problems.

    Is there a solution to apply scripts (before/after) in those cases?

    thx

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

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