USE @DBNAME 

begin tran createClockDmp
If Not Exists(SELECT     id
                FROM         syscolumns
                WHERE     (name = 'FromWeb') AND (id = OBJECT_ID(N'ClockDmp'))) 
    ALTER TABLE dbo.ClockDmp ADD FromWeb numeric(6, 0) NULL

update @DBNAME..webClockDmp set  approvedBy = perno where approvedBy is Null

if @@ERROR > 0 
  rollback tran createClockDmp	
commit 