Imagine a dynamic website. The site consist of sections and pages.
home
intro
vacancies
vacancy 1
etc
contact
sections and pages are stored in separate tables
stblsections
----------------
SectionID int (primary key)
Title varchar
parentSectionID
sortorder int
stblpages
----------------
pageID int (primary key)
title varchar
sectionID int
sortorder int
is it possible to make a query (or view / stored procedure) that will return some sort of a sitemap?
I'm thinking something like this:
SectionID | pageid | title | level | sortorder
1 1 home 0 1
null 2 intro 1 1
3 null vacancies 1 2
null 3 vacancy 1 2 1
null 4 etc 2 2
null 5 contact 1 3
home
intro
vacancies
vacancy 1
etc
contact
sections and pages are stored in separate tables
stblsections
----------------
SectionID int (primary key)
Title varchar
parentSectionID
sortorder int
stblpages
----------------
pageID int (primary key)
title varchar
sectionID int
sortorder int
is it possible to make a query (or view / stored procedure) that will return some sort of a sitemap?
I'm thinking something like this:
SectionID | pageid | title | level | sortorder
1 1 home 0 1
null 2 intro 1 1
3 null vacancies 1 2
null 3 vacancy 1 2 1
null 4 etc 2 2
null 5 contact 1 3