I have a table called BigData on SQL Server. BigData is modified by an app continuously and can't be taken offline even for a second. Another requirement is that the table can't be locked exclusively by some other process other than the app accessing it. The question is; how can I change one of the columns of BigData from Bigint to int? any suggestions?
I also recently had a question very similar to this during a PayPal interview. This situation is common with a bank or e-commerce company which has a live database which is constantly in use.
The answer I gave was to:
BigData table which looks identical except that the column has the new type.After doing this, the new and old tables should have identical content, and both should be in sync with the running application. Now, the old table can be dropped, and the new table can be renamed to the old one. It may be necessary for a brief outage (say a few minutes) to achieve this, but this should be acceptable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With