Skip to main content
New

Upgrade script should use alter table alter column where possible

Related products:Software Factory
  • July 1, 2026
  • 3 replies
  • 29 views

Arjan Sollie
Thinkwise blogger
Forum|alt.badge.img+15

Currently the Upgrade script from the Software Factory will always fully rebuild tables. This can be quite an issue when you for example need to change all your trace columns default values from getdate to getutc date. In this case all tables within your DB will be rebuild. Causing a major load and issue when executing this upgrade.

In my case I was unable to run this upgrade because of the LOG created during the upgrade. It was too large, over 100GB. 

My fix was a manually writing upgrade script, which did not rebuild the tables but simply used an alter table alter column statement.

Result was great. Script ran in under 5 minutes. The rebuild script was running over 2 hours and still not finished.

I think the Upgrade script should use alter table alter column when possible. Because it is much faster and has a significantly lower load on the server and log files.

A few examples when an alter table alter column would be more than enough:

  1. Changed domain of a column
  2. Renamed a column
  3. Changed the default value of a column 

3 replies

I agree this could be built much smarter but this one should have some additional logic: Changed domain of a column.

What if someone changed the domain from varchar to int or varchar 200 to 100. You don’t want the upgrade to fail on mismatch in data types. 


Arjan Sollie
Thinkwise blogger
Forum|alt.badge.img+15
  • Author
  • Thinkwise blogger
  • July 1, 2026

@Erwin Ekkel  Agreed, but currently even with the table rebuild, this will result in an upgrade fail. This will only work when you manually set the value in the upgrade script or use the expression option.


AndreKemmeren
Captain
Forum|alt.badge.img+4

Couldn't agree more this was one of my biggest shocks when I first started with Thinkwise.

This would cut down upgrade times ALOT for us.