CREATE procedure [dbo].[SRV_SELECT_PROFILI_SCADUTI] AS
BEGIN
	SELECT *
	FROM C6STAGINGPERIODICO.MAIL_PROFILI_RISCHIO 
	WHERE datediff(dd,dt_CREAZIONE_profilo,dateadd(mm,3,getdate()))/365.25>3
	OR PROFILO = 0
	ORDER BY DT_CREAZIONE_PROFILO
END