﻿--sp_insertIdReportPerCliente 11,752
CREATE PROCEDURE [dbo].[sp_insertIdReportPerCliente]
@IdModello as int,
@idCliente as int
AS
BEGIN
SET NOCOUNT ON;
			if(not exists(select IdCliente from [dbo].[ReportPerCliente] where IdCliente = @idCliente and IdReport = @IdModello))
			INSERT INTO [dbo].[ReportPerCliente]
					   ([DtAssociazione]
					   ,[IdReport]
					   ,[IdCliente])
				 VALUES
					   (getdate()
					   ,@IdModello
					   ,@idCliente)
	END