Home Forums SQL Server 2005 SS2K5 Replication Altering an int column to idenity in existing published table RE: Altering an int column to idenity in existing published table

  • DKlein (9/25/2013)


    Can I alter an existing int column to an identity in a table that is already published in transactional replication?

    Thanks,

    DK

    Technically speaking you can't change the identity property of an existing column (regardless of replication). If you use the UI for this the script behind the scenes actually creates a new column, copies all of the data, drops the original column and finally renames the new column to the same name as the original.

    I have never tried this on a replicated table so I am not certain what might happen there. I would certainly NOT do this in production as a test. Try this on a dev server. I am curious myself what happens here.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/