Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Sql server Getting all questions under a technology and its child (n-level)

Avatar of Chaitanya V
Chaitanya V asked on
Microsoft SQL ServerSQL
4 Comments1 Solution76 ViewsLast Modified:
I am having a technology table where I am having data as follows

    TechId Desc ParentId
       1    A     Null
       2    B      1
       3    C      1
       4    D      2

My Question table is as follows

    QId     TId      desc
     1       1        Q1
     2       2        Q2
     3       3        Q3
     4       4        Q4 

What I am trying to get is from questions table is when I select TechId 1 it should load all questions up to nth level. Result expecting is

QId TId Desc
 1      1      Q1
  2     2       Q2
  3     3        Q3
  4     4        Q4