How to Alter a Datatype With (Almost) No Downtime

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

This is going to be game changer. We have been spending weeks in migrating VLT table column from int to bigint. Thanks to you and SphagettiDBA.

DevBethanasamy
Автор

Brent it is so awesome to watch your videos and see how do you like what you do. I am mssql developer and something I know what you saying, sometime no but I always enjoy your presentation and enthusiasm.

alexnevidimkins
Автор

Awesome, I had this problem precisely a month ago on a primary key. Fortunately, at that time I could delete old records as only the last 6 months' data is required, and then reseeded the identity. I wrote a job to warn me if it approached the max int again. Unfortunately, we are still on SQL 2012 :( I will definitely revisit this when we upgrade one day.

ValleyofEndar
Автор

alter table dbo.posts alter column OwnerUserID bigint with (online = on)
also works. Not optimal, but to complete the picture. Locking seems different during operation. As mentioned ONLINE is an enterprise feature

wfvdijk
Автор

Is there a way to make this work if you go from varchar to nvarchar?

prebenhuybrechts