June 18, 2002 at 9:52 pm
How do i create a DTS package to restore data through a csv file, while i should also compare the existing data to overwrite and not delete any other data(new not within the file) from the existing table
hope somebody can help me on this issue. it is quite urgent
regards
roopa
June 19, 2002 at 2:03 am
Hi, put the dts data in a temp table. Write some sp's to update from the temp table to the real table.
June 19, 2002 at 4:22 am
Jan's method is the one I'd use, however I'd add a proviso that you either make sure you either drop the temporary table or truncate it each time before you run the DTS. Bitter experience I'm afraid nothing like populating your temporary table with several duplicate versions of the data and then wondering why your SP is still running at midnight to nmake you wary.
I have found it is possible to please all of the people all of the time if you do exactly what they want. Harold Macmillan 1961
I have found it is possible to please all of the people all of the time if you do exactly what they want. Harold Macmillan 1961
June 25, 2002 at 5:13 pm
Hi
how do i create an sp to write into a table while comparing all the data from temp table to the real table in database.
do we use cursors to open the records and use while loops in the sp
thanks in advance
roopa
June 25, 2002 at 5:36 pm
no cursors needed.
Use an UPDATE to update data.
update realtable
set cola = b.cola
, colb = b.colb
...
from temptable b
where realtable.pkcol = b.pkcol
Then use the same join to issue a delete against the temp table. This will remove matching data. Everything left is new, so insert it.
Steve Jones
June 26, 2002 at 11:07 pm
Thanks a lot for your suggestion
roopa
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply