USP_DATALIST_CMSDISTINCTEDUCATIONALDEGREES

Parameters

Parameter Parameter Type Mode Description
@USEACADEMICCATALOG bit IN
@AFFILIATEDONLY bit IN

Definition

Copy


create procedure dbo.USP_DATALIST_CMSDISTINCTEDUCATIONALDEGREES
(
    @USEACADEMICCATALOG bit = 0,
  @AFFILIATEDONLY bit = 0
)
as
    set nocount on;

-- If Academic Catalog is turned on AND we only want the affiliated institution information, get strictly from ACADEMICCATALOGDEGREE

  if @USEACADEMICCATALOG = 1 and @AFFILIATEDONLY = 1
  begin
    select distinct AC.NAME
    from
       dbo.ACADEMICCATALOGDEGREE AC;
  end
-- If Academic Catalog is turned on AND we want both affiliated and non-affiliated institution information, grab from ACADEMICCATALOGDEGREE and EDUCATIONALDEGREECODE

  else if @USEACADEMICCATALOG = 1 and @AFFILIATEDONLY = 0
  begin
    select distinct EC.DESCRIPTION as NAME
    from
         dbo.EDUCATIONALDEGREECODE EC
    union 
    select distinct AC.NAME
    from
         dbo.ACADEMICCATALOGDEGREE AC;
  end
-- If Academic Catalog is turned off then we grab only from EDUCATIONALDEGREECODE

  else
  begin
    select distinct EC.DESCRIPTION as NAME
    from
      dbo.EDUCATIONALDEGREECODE EC;
  end