IF NOT EXISTS(
  SELECT SysColumns.Name FROM SysObjects WITH (NOLOCK) 
  INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID AND SysColumns.Name='OriginalGlobalTransactionNumber'
  WHERE SysObjects.Name = 'Transactions')
BEGIN
  DECLARE @sql VARCHAR(500)

  SET @sql = 'ALTER TABLE Transactions ADD OriginalGlobalTransactionNumber INT'
  EXEC sp_sqlexec @sql
  
  SET @sql = 'UPDATE Transactions SET OriginalGlobalTransactionNumber = GlobalTransactionNumber WHERE OriginalGlobalTransactionNumber IS NULL'
  EXEC sp_sqlexec @sql

  SET @sql = 'ALTER TABLE Transactions ALTER COLUMN OriginalGlobalTransactionNumber INT NOT NULL'
  EXEC sp_sqlexec @sql
END