DECLARE @Id Int                               
SELECT @Id = Id From sysobjects Where Name = 'tmpDrugH'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'FamilyDoctorCode')
  ALTER TABLE dbo.tmpDrugH ADD FamilyDoctorCode INT NULL DEFAULT(0)


SELECT @Id = Id From sysobjects Where Name = 'DrugH'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'FamilyDoctorCode')
  ALTER TABLE dbo.DrugH ADD FamilyDoctorCode INT NULL DEFAULT(0)


IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'[dbo].[Sodor_Factor_Drug]')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
    DROP PROCEDURE [dbo].[Sodor_Factor_Drug]


IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'[dbo].[Reverse_FactorFinal_Drug]')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
    DROP PROCEDURE [dbo].[Reverse_FactorFinal_Drug]

