USP_SIMPLEDATALIST_PDACCOUNTCODEMAPMERCHANDISEDEPARTMENT

Returns a list of merchandise departments and an all merchandise departments entry.

Definition

Copy


create procedure dbo.USP_SIMPLEDATALIST_PDACCOUNTCODEMAPMERCHANDISEDEPARTMENT as
    select
        VALUE,
        LABEL
    from (
        select
            '99999999-9999-9999-9999-999999999999' as VALUE,
            'All merchandise departments' as LABEL,
            0 as SEQUENCE

        union all

        select
            ID as VALUE
            NAME as LABEL,
            1 as SEQUENCE
        from
            dbo.MERCHANDISEDEPARTMENT
        where
            ISACTIVE = 1
    ) as MERCHANDISEDEPARTMENTS
    order by
        SEQUENCE, LABEL;