Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'Tmp_Over_Under_Factor_Cash'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'AutoId')
  Alter Table dbo.Tmp_Over_Under_Factor_Cash Add AutoId BIGINT IDENTITY(1,1) PRIMARY KEY
