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
Viewing all articles
Browse latest Browse all 4

Answer by Susang for How to change primary key's data type from int to bigint in a huge transactional database under tremendous load?

$
0
0

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 test

Then verify the data in new table and remove old one and again rename new table name as old one.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>