Quantcast
Channel: How to change primary key's data type from int to bigint in a huge transactional database under tremendous load? - Database Administrators Stack Exchange
Browsing latest articles
Browse All 4 View Live

Answer by SnapJag for How to change primary key's data type from int to...

As an interim solution since you said you can't shut down the system, at least maybe for a short time... Remember that the data type is a signed INT (pos2bil to neg2bil), meaning there are 4bil records...

View Article



Answer by Martin Smith for How to change primary key's data type from int to...

Assuming your current table is something likeCREATE TABLE YourTable ( Id INT IDENTITY PRIMARY KEY, OtherColumns VARCHAR(10) )And that your existing code that references the table just performs basic...

View Article

Answer by Susang for How to change primary key's data type from int to bigint...

You can use this technique, first create new table as following with the conversion of datatype by copying first table structure:SELECT id, CAST(test_id AS BIGINT) test_id INTO test_new FROM testThen...

View Article

How to change primary key's data type from int to bigint in a huge...

This is a legacy system, with more than 1 billion records in a table that undergoes 10 million transactions per day.Now the application complains that:Arithmetic overflow error converting IDENTITY to...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images