June 23, 2005 at 2:46 am
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
June 23, 2005 at 3:21 am
You should use convert/cast in your insert command.
June 23, 2005 at 6:17 am
You could probabely use dts o transfer data insted of looping... will make the whole thing much faster.
June 23, 2005 at 4:45 pm
I agree with Remi. Use DTS and do the data conversion en route to the new database.
Greg
Greg
June 26, 2005 at 12:05 pm
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