Hi,
I have a table with 70 million records. I want to change the datatype of one of the columns from int to decimal(18,3). What is the best way of doing it? and how can I evaluate the time change before I start and make the change?
thank you,
Tomer
..assuming you want to know how long the operation would take....this varies massively by table definition + indexes + hardware + load
you could use SELECT INTO to create a table of one million records and add indexes identical to those on the production table.
Then drop the index on the int column on that table,
execute an ALTER TABLE ALTER COLUMN to change the datatype
and rebuild the index.
Then multiply the result by 70 though that's only an estimate as the rebuild time may not be linear.
No comments:
Post a Comment