Merge - Trigger Script

  • When I run the initial snapshot that generates schema and trigger scripts, there are two sets of triggers scripted with differing Article ID GUIDs. I have looked into the sysmergearticles table but only found the articles that I expected; not twice the number.

    Does anyone know where these extraneous IDs could be coming from and what is the best way to rectify the situation?

    Much thanks,

    Steve Hendricks

    MCSD, MCDBA

    AFS Consulting Group

    shendricks@afsconsulting.com

    (949) 588-9800 x15


    Steve Hendricks
    MCSD, MCDBA
    Data Matrix

    shendricks@afsconsulting.com
    (949) 588-9800 x15

  • And the answer is...

    There was a set of replication triggers defined from a previous attempt to configure replication. They should have been dropped when the other replication objects were removed but that's another story.

    i created a cursor that defined the bad triggers and walked through it dropping the triggers as I went.

    declare csr Cursor

    for select tr.name

    from sysobjects tr

    join sysobjects t on tr.parent_obj = t.id

    join sysmergearticles ma on ma.objid = t.id

    where ObjectProperty(tr.id, N'IsTrigger') = 1

    and left(tr.name, 4) in 'ins_', 'upd_', 'del_')

    and right(tr.name, 32) <>

    substring(cast(ma.artid as varchar(40)), 1, 8) +

    substring(cast(ma.artid as varchar(40)), 10, 4) +

    substring(cast(ma.artid as varchar(40)), 15, 4) +

    substring(cast(ma.artid as varchar(40)), 20, 4) +

    substring(cast(ma.artid as varchar(40)), 25, 12)

    order by 1

    for read only

    This seems to have turned the trick.

    Steve Hendricks

    MCSD, MCDBA

    AFS Consulting Group

    shendricks@afsconsulting.com

    (949) 588-9800 x15


    Steve Hendricks
    MCSD, MCDBA
    Data Matrix

    shendricks@afsconsulting.com
    (949) 588-9800 x15

Viewing 2 posts - 1 through 1 (of 1 total)

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