Changing of Data type int to Big int in production Database which is used for replication

  • Hi,

    I would like to know how to Change the Data type int to Big int in production Database which is used for replication.

    Example :

    Assuming I have two tables Address, Users, AddressType

    The PK field In AddressType Table Is AddresTypeID which is int

    and the table Address refers the AddresTypeID from AddressType Table for the field AddressTypeRef which is also of int datatype, AddressID in Address Table is also of Int data type and in the USers table the AddressID is also int data type and UserID in Users Table is also of the type int and the USerID in users table is refered for so many tables.

    Now my request is how to change the type from int to Bigint where in the tables are related and it has PK, FK Constraints for the tables.

    Purpose of changing the datatype from int to bigint is i had used the seedvalue for all the autogenerated fields, now for int data type it can take upto 999999999. So if it exceeds that then it will be big problem, so now i need to change the data type from int to bigint.

    With Regards

    Dakshina Murthy

  • Hi,

    Is this a big table ?

    Can it be removed from the publication, altered and then put back in ??

    Regards

    Graeme

  • Yes most of them are big tables.

  • There is only one option to do it. That is drop the table from Replication and then add it after the alter commands are done.

    To add it there are two options.

    1. Add the Table and re snap shot it.

    2. If down time is possible, then Add the table and dont initialize the table in the subscriber. Since you have the data already in subscriber , there is no need to re initialize the data

    -Roy

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

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