SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
dakshinamurthy-655138
dakshinamurthy-655138
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1278 Visits: 1056
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
Graeme100
Graeme100
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2366 Visits: 795
Hi,

Is this a big table ?

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

Regards
Graeme



dakshinamurthy-655138
dakshinamurthy-655138
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1278 Visits: 1056
Yes most of them are big tables.
Roy Ernest
Roy Ernest
SSCrazy Eights
SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)

Group: General Forum Members
Points: 8655 Visits: 6891
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search