
Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'Doctor'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Code2')
  ALTER TABLE Doctor ADD Code2 varchar(3) null 
