dbTalk Databases Forums  

Excel file into 3 different sql tables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Excel file into 3 different sql tables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shawn
 
Posts: n/a

Default Excel file into 3 different sql tables - 10-12-2004 , 02:14 PM






I have an Excel file that has the following data.

name, address, city, state, zip, organization, oaddess,
ostate, ozip, pname, paddress, pcity, pstate,pzip

O = Organization
P = Parent

Now there are about 2000 records in that Excel file that
needs to be exported into 3 tables (Student, Organization,
Parent)

Student table has StudentID which is primary key.
Organization has OrganizationID and StudentID. Parent
table has parent table, but there is a table
(StudentParent) that has ParentID, StudentID.

How can I export those records ensuring that each table
includes the studentID which will be created from the
insertion? StudentID is an Identity column. I need to be
able to tell which Organization and Parents belong to that
student, Using DTS. Is that possible and what is the best
way to achieve that conclusion?

Shawn

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Excel file into 3 different sql tables - 10-13-2004 , 05:46 AM






You cold do this with a single DataPump, where the destination is either the
Organization or Parent table. The other two tables you would insert through
a lookup query. This would be held together through a single ActiveX
Transform. However I think it would be easier to import the data into a
single table in SQL, and then use a normal TSQL query to do the
transformation.


--
Darren Green
http://www.sqldts.com

"Shawn" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have an Excel file that has the following data.

name, address, city, state, zip, organization, oaddess,
ostate, ozip, pname, paddress, pcity, pstate,pzip

O = Organization
P = Parent

Now there are about 2000 records in that Excel file that
needs to be exported into 3 tables (Student, Organization,
Parent)

Student table has StudentID which is primary key.
Organization has OrganizationID and StudentID. Parent
table has parent table, but there is a table
(StudentParent) that has ParentID, StudentID.

How can I export those records ensuring that each table
includes the studentID which will be created from the
insertion? StudentID is an Identity column. I need to be
able to tell which Organization and Parents belong to that
student, Using DTS. Is that possible and what is the best
way to achieve that conclusion?

Shawn



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.