﻿--[C6Mart].[PL_D_S179EmittentiConcentrazioneAlta] 'F', 'GNSMRN59L62L219S'
CREATE procedure [C6Mart].[PL_D_S179EmittentiConcentrazioneAlta]--'F','GNSMRN59L62L219S'
	-- Add the parameters for the stored procedure here
	@Rete char(1), 
	@CodiceFiscale varchar(16)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	select a.RETE,a.COD_FISCALE,a.Ordine,a.Emittente,a.ctv,a.flagAdeguatezza,a.franchigia,a.percConcentrazione,a.rating,a.sogliaConcentrazione
	from C6Mart.TB_S179EmittentiConcentrazioneAlta a
	inner join C6Staging.VAR_ADEGUATEZZA_INDICATORI i on 
	a.RETE=i.RETE and a.COD_FISCALE=i.CODICE_FISCALE 
	where a.rete = @Rete
	and a.Cod_Fiscale = @CodiceFiscale
	and i.CE_ADEGUATEZZA_INDICATORE=0
	order by emittente
END