SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE procedure [dbo].[p_risks_get_last_situation_info]
	@risks_ids type_table_id readonly

as
	set nocount on;

	select	rr.ris_risk_id,
			rr.ris_last_risk_situation_id,
			rr.ris_situations_count
	from ris_risks(nolock) rr
		inner join @risks_ids ri on ri.id = rr.ris_risk_id
GO
