Newbee, Need help in adding data from one DB to another

  • Hi,

     

    I have an old DB which I need to add some data to a new one.

    Using the commands INSERT INTO NEW (COl1,col2,....col40) VALUES(col1,col245....col34) FROm OLDDB

    IS ok, But it seems that the type of DATA are different (the DB are from different programs).

    So in the OLDDB it is an INTEGER and in the new it is a VARCHAR. And sometimes the DATA is fixed.

     

    So my questions are:

    1) how to use a LOOP or DO WHILE, so it will copy every record

    2) CAn you pass data from an OLDBD to a NEWDB, using a combination of FIXED values and columns of the OLDDB???

     

    Any help is welcome

     

    David

     

  • You should use convert/cast in your insert command.

  • You could probabely use dts o transfer data insted of looping... will make the whole thing much faster.

  • I agree with Remi.  Use DTS and do the data conversion en route to the new database.

    Greg

    Greg

  • I also agree with Greg and Remi. You can create a DTS package that uses a select into statement. Then you can transform the data as needed and insert into the target end table.

Viewing 5 posts - 1 through 4 (of 4 total)

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