append select results to exisiting table - Query structure

  • Hi

    i have quiet a large SQL script that links to a DB on another server. The script contains some datediffs and case statements but nothing too complex.

    I am going to schedule this select script to run at midnight and i want the results to be placed in a table in my DB. Every night when the job runs, I need to add those results to the previous nights resulst so over time i will build up a history of snapshots.

    How do i structure my query in order to do this.

    I have tried

    sample script obviously as its the structure i'm after

    select * into exisiting_table from linked_table

    This just tells me the table already exisists.

    I used the create table script to build the second tabel so all columns are exact.

    Any Ideas

    Many Thanks

  • got it, so simple as er usual i was over complicating things..

    insert into table_names select ............

    duh !!!!

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

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