Regarding CTE IN sql server 2005

  • Hi Friends,

    I want to use Cte in my sql server 2005.What is Cte .why we will go for cte.

    Then coming to my doubt i have two tables.1.Menus,2.Menu items.

    USING CTE I WANT BASED ON MENU I WANT TO GET menu items from 2nd table................

  • Please read the article linked in my signature line. If you post more information someone will probably be able to help. With the limited information you have provided it is practically impossible to provide a solution.

  • thummalalavanya (8/7/2009)


    Hi Friends,

    I want to use Cte in my sql server 2005.What is Cte .why we will go for cte.

    Then coming to my doubt i have two tables.1.Menus,2.Menu items.

    USING CTE I WANT BASED ON MENU I WANT TO GET menu items from 2nd table................

    So what is with wanting to use CTE's when you don't even have a query between two tables yet?

  • thummalalavanya (8/7/2009)


    Hi Friends,

    I want to use Cte in my sql server 2005.What is Cte .why we will go for cte.

    Then coming to my doubt i have two tables.1.Menus,2.Menu items.

    USING CTE I WANT BASED ON MENU I WANT TO GET menu items from 2nd table................

    If you don't know what a CTE is or "why we will go for cte", how do you know that it's appropriate to use one for your problem? Before you ask those questions, you might want to take a look at "Common Table Expressions" in Books Online.

    From your question, it also sounds like you may need to lookup "joins [SQL Server]" in Books Online as well as reading the article in the first link in my signature below.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply