Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 862061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:04:51+00:00 2026-05-15T09:04:51+00:00

My nested set table is as follows. create table depts ( id int identity(0,

  • 0

My nested set table is as follows.

 create table depts (
  id int identity(0, 1) primary key
  , lft int
  , rgt int
  , name nvarchar(60)
        , abbrv nvarchar(20)
 );

Test departments.

insert into depts (lft, rgt, name, abbrv) values (1, 14, 'root', 'r');
insert into depts (lft, rgt, name, abbrv) values (2, 3, 'department 1', 'd1');
insert into depts (lft, rgt, name, abbrv) values (4, 5, 'department 2', 'd2');
insert into depts (lft, rgt, name, abbrv) values (6, 13, 'department 3', 'd3');
insert into depts (lft, rgt, name, abbrv) values (7, 8, 'sub department 3.1', 'd3.1');
insert into depts (lft, rgt, name, abbrv) values (9, 12, 'sub department 3.2', 'd3.2');
insert into depts (lft, rgt, name, abbrv) values (10, 11, 'sub sub department 3.2.1', 'd3.2.1');

My web content table is as follows.

 create table content (
  id int identity(0, 1)
  , dept_id int
  , page_name nvarchar(60)
  , content ntext
 );

Test content.

insert into content (dept_id, page_name, content) 
 values (3, 'index', '<h2>welcome to department 3!</h2>');
insert into content (dept_id, page_name, content) 
 values (4, 'index', '<h2>welcome to department 3.1!</h2>');
insert into content (dept_id, page_name, content) 
 values (6, 'index', '<h2>welcome to department 3.2.1!</h2>');
insert into content (dept_id, page_name, content) 
 values (2, 'what-doing', '<h2>what is department 2 doing?/h2>');

I’m trying to query the correct page content (from the content table) based on the url given. I can easily accomplish this task with a root department. However, querying a department with multiple depths is proving to be a little harder. For example:

http://localhost/departments.asp?d3/ (Should return <h2>welcome to department 3!</h2>)
http://localhost/departments.asp?d2/what-doing (Should return <h2>what is department 2 doing?</h2>)

I’m not sure if this can be create in one query or if there will need to be a recursive function of some sort. Also, if there is nothing after the last / then assume we want the index page.

This would basically be the back end of a small CMS. So my thought was that you could create new pages with a unique name associated to a category. Which in my case, would be departments. I have looked around and there aren’t very many choices in terms of CMS for ASP Classic.

How can this be accomplished? Comments and suggestions also welcomed.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:04:52+00:00Added an answer on May 15, 2026 at 9:04 am

    I did something very similar to this (except with PHP/MySQL). I don’t have the code in front of me, but I would be happy to supply it to you if you think it might help:

    I believe the main difference in my approach was that I didn’t have a separate table with the nested set, I just had content and lft/rgt together in one table. The content management allowed the user to create a content hierarchy with as much depth as they dared, so the site could turn out something like:

    http://site/tier1-page
    http://site/tier1-page/tier2-pageA
    http://site/tier1-page/tier2-pageB
    http://site/tier1-page/tier2-pageB/tier3-pageI
    http://site/tier1-page/tier2-pageB/tier3-pageII
    

    …and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Nested If or single if with And operator, which is better approach? Single If
I am using some nested layouts in Ruby on Rails, and in one of
I have some nested tables that I want to hide/show upon a click on
How have you explained nested arrays to a programmer. I'm thinking someone that has
I have a nested function to show/hide paragraphs news-ticker-style. The problem is that when
I have nested dictionaries: {'key0': {'attrs': {'entity': 'p', 'hash': '34nj3h43b4n3', 'id': '4130'}, u'key1': {'attrs':
In JavaScript nested functions are very useful: closures, private methods and what have you..
I have nested xsl:for loops: <xsl:for-each select=/Root/A> <xsl:for-each select=/Root/B> <!-- Code --> </xsl:for> </xsl:for>
I have a nested movie clip instance that I want to access. The path
I have a three nested classes, Show, Season and Episode, where a show has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.