Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Changing of Data type int to Big int in production Database which is used for replication Expand / Collapse
Author
Message
Posted Monday, February 2, 2009 10:40 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 8:29 AM
Points: 330, Visits: 969
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
Post #648579
Posted Monday, February 9, 2009 7:27 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, September 12, 2014 3:19 AM
Points: 1,221, Visits: 694
Hi,

Is this a big table ?

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

Regards
Graeme



Post #652804
Posted Monday, February 9, 2009 9:40 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 8:29 AM
Points: 330, Visits: 969
Yes most of them are big tables.
Post #653385
Posted Wednesday, February 11, 2009 7:54 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, September 12, 2014 8:23 AM
Points: 3,313, Visits: 6,717
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
Post #654841
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse