CREATE PROCEDURE CP_Tab_Reportes_Borrar @Id_Reporte VARCHAR(50)
AS
DECLARE @Mensaje			VARCHAR(100)
BEGIN TRY
	BEGIN TRAN

	DELETE Tab_Reportes_xCampos WHERE Id_Reporte = @Id_Reporte
	DELETE Tab_Reportes_Users WHERE Id_Reporte = @Id_Reporte
	DELETE Tab_Reportes_Col WHERE Id_Reporte = @Id_Reporte
	DELETE Tab_Reportes_Bandas WHERE Id_Reporte = @Id_Reporte
	DELETE Tab_Reportes WHERE Id_Reporte = @Id_Reporte

	COMMIT
	SELECT	 0					AS ErrorNumber 
			,0					AS ErrorSeverity  
			,0					AS ErrorState 
			,0					AS ErrorProcedure  
			,0					AS ErrorLine		
			,@Mensaje			AS ErrorMessage
			,@Id_Reporte		AS Id_Reporte

END TRY  


BEGIN CATCH  
    EXECUTE usp_GetErrorInfo;  
	ROLLBACK
END CATCH;   

