﻿DROP PROCEDURE IF EXISTS [dbo].[sp_GetEgyuttmukodesiMeglallapodas]
GO

CREATE PROCEDURE [dbo].[sp_GetEgyuttmukodesiMeglallapodas]
  @pTanevId  INT
AS
BEGIN

  SET NOCOUNT ON;

/*INTEZMENYADATOK*/
  SELECT DISTINCT
    INTEZMENY.C_NEV                                   Nev
    ,INTEZMENY.C_IGAZGATONEVE                         IgazgatoNev
    ,dbo.fnGetDokumentumIntezmenyCime (@pTanevId)     IntezmenyCim
    ,INTEZMENY.C_TELEFONSZAM                          IntezmenyTelefonszam
    ,INTEZMENY.C_EMAILCIM                             IntezmenyEmail
    ,INTEZMENY.C_OMKOD                                OktAzon
  FROM T_TANEV TANEV 
    INNER JOIN T_INTEZMENYADATOK_OSSZES INTEZMENY ON TANEV.ID = INTEZMENY.C_TANEVID 
  WHERE TANEV.ID = @pTanevId
   
END

GO