IF EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name = N'CreatedOld' AND Object_ID = Object_ID(N'BA_SiteHistory'))
BEGIN
		UPDATE a SET a.Created = cast(b.CreatedOld as datetimeoffset(7))
		FROM BA_SiteHistory a INNER JOIN BA_SiteHistory b ON a.Id = b.Id

		ALTER TABLE [dbo].BA_SiteHistory DROP COLUMN CreatedOld
END;