spGetTeamListSeasons

Definition

Copy

CREATE PROCEDURE [dbo].[spGetTeamListSeasons] AS
SET NOCOUNT ON

    SELECT DISTINCT cte.description season, cte.EntryGuid
    FROM dbo.SiteCodeTableEntries cte
        INNER JOIN dbo.ATHLETICS_TEAMS at
            ON cte.EntryGuid = at.season
        INNER JOIN dbo.UserPages up
            ON up.RealmContextID = at.ID
        INNER JOIN dbo.UserPageManagerPageTemplates upt
            ON up.UserPageTemplateID = upt.ID
    WHERE upt.RealmType = 7 --Core.Data.PersonalPageData.EParentTypes.AthleticTeam

        AND up.IsPublished = 1
    ORDER BY season ASC