Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Appending Values

Author  Topic 

akki007
Starting Member

2 Posts

Posted - 2007-08-02 : 04:49:53
Hi all, new here!

I have a text file that contains...

Person Name 1, DOB 1, Gender 1, Attendance 1
Person Name 1, DOB 1, Gender 1, Attendance 2
Person Name 1, DOB 1, Gender 1, Attendance 3
Person Name 1, DOB 1, Gender 1, Attendance 4
Person Name 1, DOB 1, Gender 1, Attendance 5
Person Name 1, DOB 1, Gender 1, Attendance 6
Person Name 1, DOB 1, Gender 1, Attendance 7

I need to append the attendance rows together so I end up with...

Person Name 1, DOB 1, Gender 1, Attendance 1+Attendance 2+Attendance 3....


Would it be possible to use DTS to import the text file into a table in this new appended format?

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-09 : 11:29:17
You can import into a temp table and then from that temp table
you can use the RUN SQL TASK

and do the following

Insert into TABLE select
personname, DOB, gender, sum(attendence)
from temptable
group by personname, dob, gender.

Ashley Rhodes
Go to Top of Page
   

- Advertisement -