TSQL Help, Possible a recursive CTE

  • erics44 wrote:

    -- Create TableA CREATE TABLE TableA ( MainID INT, JoiningID INT );

    -- Insert data into TableA INSERT INTO TableB (MainID, JoiningID) VALUES

    (No column name)

    ...

    Heh... you didn't try to run your own code... not only does it not run as is but it only has one CREATE TABLE and one table populating INSERT.

    --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)

  • 2nd page bump to get post to appear

    --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)

  • Jeff Moden wrote:

    erics44 wrote:

    -- Create TableA CREATE TABLE TableA ( MainID INT, JoiningID INT );

    -- Insert data into TableA INSERT INTO TableB (MainID, JoiningID) VALUES

    (No column name)

    ...

    Heh... you didn't try to run your own code... not only does it not run as is but it only has one CREATE TABLE and one table populating INSERT.

    Jeff Moden wrote:

    erics44 wrote:

    -- Create TableA CREATE TABLE TableA ( MainID INT, JoiningID INT );

    -- Insert data into TableA INSERT INTO TableB (MainID, JoiningID) VALUES

    (No column name)

    ...

    Heh... you didn't try to run your own code... not only does it not run as is but it only has one CREATE TABLE and one table populating INSERT.

    There's a post earlier suggesting it should be all in one table so I put it all in one table

     

    do you want me to split it back into 2 tables, would that make it easier for you?

    • This reply was modified 4 months, 1 week ago by  erics44.

Viewing 3 posts - 16 through 17 (of 17 total)

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