Insert into existing table from Query

  • I created a table from a Select Into command.

    SELECT col1,col2,col3 INTO t_Table2 from t_Table1 where id > 23 and active = 1

    I'd now like to insert more values into this table from a similar select query. I know I can accomplish adding the data by Insert Exec with a SP or a Cusor but I'm trying to keep it simple. Out of all the things I've done in SQL I've never inserted data this way. Can it be done?  TIA.

  • If the table is already created, the syntax is:

    INSERT INTO t_Table2

    SELECT col1,col2,col3

    FROM   t_Table1

    WHERE id > 23 and active = 1

  • Thanks much PW. It worked great.

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

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