MOVING DATA BETWEEN SERVERS

I got a dts package to move data from one server to another. It ends up in a results table. I am tryin gto truncate a 4 field table and then repopulate it from this results table (same 4 fields) Seems easy but for some reason it is beyond me LOL.

Can someone please tell me what the syntax should be after truncating the table that is to get the information. Or should I drop it and do insert into



Answer this question

MOVING DATA BETWEEN SERVERS

  • Scripto

    Well, if you're simply moving the data from the results table to the truncated table, for best performance I'd simply drop the truncated table your talking about, then have the DTS package push data into a new table named the same as the dropped table.

    If you need to import into a staging table first, for filtering/scrubbing/etc., your next best performing option would be to drop the table instead of truncating, then performing a bulk operation using select...into:

    select <columns> into <dropped table name> from <results table> where <filters>

    If you can't do that, guess you're stuck using a straight insert statement:

    insert <truncated table name> (<columns>) select <columns> from <results table>

    HTH



  • JulienH

    INSERT INTO TheTruncatedTable
    (
    Col1,
    Col2,
    Col3,
    Col4
    )
    SELECT
    Col1,
    Col2,
    Col3,
    Col4
    From ResultsTable

    Did you mean this

    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

  • MOVING DATA BETWEEN SERVERS