DECLARE @Id Int                               

Select @Id = Id From sysobjects Where Name = 'TmpDrugh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'PrescriptionType')
  Alter Table TmpDrugh Add PrescriptionType TINYINT NULL DEFAULT(0)

Select @Id = Id From sysobjects Where Name = 'TmpDrugh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'PrescriptionId')
  Alter Table TmpDrugh Add PrescriptionId UNIQUEIDENTIFIER NULL 


Select @Id = Id From sysobjects Where Name = 'Drugh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'PrescriptionType')
  Alter Table Drugh Add PrescriptionType TINYINT NULL DEFAULT(0)

Select @Id = Id From sysobjects Where Name = 'Drugh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'PrescriptionId')
  Alter Table Drugh Add PrescriptionId UNIQUEIDENTIFIER NULL 

