CREATE PROCEDURE [dbo].[sp_deleteReportFromDB_ByIdReport]
@idReport as int
AS
BEGIN
	SET NOCOUNT ON;
BEGIN TRANSACTION
	DELETE FROM [dbo].[ReportSezionePers]   --figli
		  WHERE ReportSezionePers.IdReport = @idReport
	DELETE FROM [dbo].[ReportPerClienteDati]   
		  WHERE ReportPerClienteDati.IdReport = @idReport
	DELETE FROM [dbo].[ReportPerCliente]   
		  WHERE ReportPerCliente.IdReport = @idReport
	DELETE FROM [dbo].[Report]				--padri
		  WHERE Report.IdReport = @idReport
COMMIT
END