• performance wise, SQL server can insert millions of rows in about the same time as a single row or small number of rows,
    so breaking up an operation into multiple steps would be that many steps slower(in your example, 22 times or so) ,
    so the first question everyone will have is why? there's no reason to break it up, especially with a small amount of records.

    regardless, to do something like this you need a loop of some kind. a cursor or while loop can do the iteration you are asking.
    The more detail you provide, the better example we can give you.
    It SEEMS like you are asking how to insert data into TWO tables, like a header/detail, right?
    for that, if you need a reference to the header table, you need the output clause, or to re-join the header to the insert based on the description inserted.
    the typical way to do it all at once in a pair of statements

    CREATE TABLE Articles(
    Articleid INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    Title VARCHAR(100) )
    INSERT INTO Articles(Title)
    SELECT Header FROM SomeOtherTable

    INSERT INTO ArticleDetails(Articleid ,ArticleBody)
    SELECT at.ArticleID,ot.Detail FROM SomeOtherTable ot
    INNER JOIN Articles at ON ot.Header = at.Title

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!