SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE proc [dbo].[p_test_claim_delete_by_id]
	@claim_id int
as

	/*
	[DGE]
	Cette procédure est utilisée pour tester les fonctionnalités. 
	Il ne faut pas l'utiliser sur les bases de production.


	*/



	delete	d
	from	claim_variables_recoveries d
	where	d.clvr_claim_id = @claim_id


	delete	d
	from	claim_variables_provisions d
	where	d.clvp_claim_id = @claim_id


	delete	d
	from	claim_variables_accounts d
	where	d.clacc_claim_id = @claim_id


	delete	d
	from	claim_variables d
	where	d.clv_claim_id = @claim_id

	delete	d
	from	claim_actors_cpl d
	where	d.clactcpl_claim_id = @claim_id

	delete	d
	from	claim_actors d
	where	d.clact_claim_id = @claim_id

	delete	d
	from	claim_cpl d
	where	d.ccpl_claim_id = @claim_id

	delete	d
	from	claim_claims d
	where	d.cl_claim_id = @claim_id


GO
