if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Delete_Mandeh_Data]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Delete_Mandeh_Data]

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]


DECLARE @Id Int                               

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

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