I'm writing a database table designer (works like the Enterprise Manager one, but with restricted datatypes and some checks), and I have a bit of a question:
To alter the structure of a table, I'm currently using the same method as Enterprise Manager (create a temporary table with the new schema, copy the data across, drop the original table, rename the temporary table).
When altering the structure of a table with a large number of rows, but not changing the order of columns or adding columns in the middle of the table:
- Would it be faster to execute multiple ALTER TABLE statements?
- If so, at what point would it become slower? (Say, changing lots of column data types, etc).
Thanks