IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'stor.[sp_DeleteMdlpInventoryDocumentProcess]') AND type in (N'P', N'PC'))
DROP PROCEDURE stor.[sp_DeleteMdlpInventoryDocumentProcess]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.[sp_DeleteMdlpInventoryDocumentProcess]') AND type in (N'P', N'PC'))
DROP PROCEDURE dbo.[sp_DeleteMdlpInventoryDocumentProcess]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      Vitacore (с) Anatoliy
-- Create date: 2023 08 02
-- Description: Удаление данных Документ инвентаризации МДЛП
-- =============================================
CREATE PROCEDURE stor.[sp_DeleteMdlpInventoryDocumentProcess]
    @Id uniqueidentifier
AS
BEGIN
	delete from STOR.T_MDLP_INVENTORY_ELEMENTS where MdlpInventoryDocument = @Id
	delete from STOR.T_MDLP_INVENTORY_DOCUMENT where MdlpInventoryDocumentID = @Id
END