Amending a column used in merge replication

  • Does anyone know if it is possible to amend a column definition while it is included in an article for merge replication? I know you can add and drop using the sp_replAddcolumn sp_repldropcolumn SP's respectively but is there an amend one? If not can i do a drop and then re add or will this screw my publication?

    Thanks in advance.

    John

  • Done some more digging and got a work around..

    The direct answer is no, there is no altercolumn Sp. However the script below does the job. Please note that any index's on the columns will need to be dropped first at publisher and subscriber and then readded.

    exec sp_repladdcolumn @source_object = 'tEmployees'

    , @column = 'TempForename'

    , @typetext = 'varchar(100) NULL'

    , @publication_to_add = 'tTestFNames'

    update tEmployees set TempForename = Forename

    exec sp_repldropcolumn @source_object = 'tEmployees'

    , @column = 'Forename'

    exec sp_repladdcolumn @source_object = 'tEmployees'

    , @column = 'Forename'

    , @typetext = 'varchar(100) NULL'

    , @publication_to_add = 'tTestFNames'

    update tEmployees set Forename = TempForename

    exec sp_repldropcolumn @source_object = 'tEmployees'

    , @column = 'TempForename'

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

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