USP_SIMPLEDATALIST_SIMPLEACKLETTERS

Returns a list of available simple acknowledgement letters

Definition

Copy


create procedure dbo.USP_SIMPLEDATALIST_SIMPLEACKLETTERS as
    select 
        ID as VALUE
        NAME as LABEL
    from 
    dbo.COMMUNICATIONLETTER
  where
    COMMUNICATIONTYPECODE = 3 and 
    ID = (select top 1 SUBC.ID from dbo.COMMUNICATIONLETTER as SUBC where SUBC.NAME = COMMUNICATIONLETTER.NAME) -- Name is not a unique on its own

    order by 
    NAME