dbTalk Databases Forums  

Mapping Single Source Data to Multiple Tables

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


Discuss Mapping Single Source Data to Multiple Tables in the microsoft.public.sqlserver.dts forum.



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

Default Mapping Single Source Data to Multiple Tables - 02-15-2005 , 11:05 AM






Hi,

I have a small project in which I have to import fields from a csv/xls file
and map it
to multiple tables within a database ensuring field validations and
referential integrity between tables, i.e. Insert/Update per the
Parent-Child relationships.

I have been reviewing DTS Designer info but unable to come up with a
conclusion whether I can successfully do it and if yes then is there any
sample code for similar task.

I need some help in this area and it is kind of urgent. Any tips/leads in
this regards would really appreciated.

I would welcome e-mail or phone response.

Thanks,

Paul
Atlanta, GA
706-315-5956


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Mapping Single Source Data to Multiple Tables - 02-15-2005 , 02:03 PM






OK

DTS does not have the know how to be thrown some files and just import
them in the right order.

Personally I would

Import the file into a staging/working table
Using TSQL grab the columns from this table that go into the master
table
Grab the columns that go into the Child table
After importing the Master table rows(columns)
You keep the mapping between the Master table and the working table so
that you know with what ID to tag the child records when entering them.

Allan

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

Quote:
Hi,

I have a small project in which I have to import fields from a csv/xls
file
and map it
to multiple tables within a database ensuring field validations and
referential integrity between tables, i.e. Insert/Update per the
Parent-Child relationships.

I have been reviewing DTS Designer info but unable to come up with a
conclusion whether I can successfully do it and if yes then is there any

sample code for similar task.

I need some help in this area and it is kind of urgent. Any tips/leads in

this regards would really appreciated.

I would welcome e-mail or phone response.

Thanks,

Paul
Atlanta, GA
706-315-5956


Reply With Quote
  #3  
Old   
paul2010
 
Posts: n/a

Default Re: Mapping Single Source Data to Multiple Tables - 02-15-2005 , 03:19 PM



Allan,

Thanks for your tips. I understand the logic behind staging table and then
populating Master and Child table.

My question is that I have at least 8-10 destination tables and they are
related via FKs with no one table acts a Master table. Is there a way within
DTS to read schema from my database and identify PK and FKs and popolute the
Master and Children tables accordingly from the a single source table? Or do
I have to write a complex ActiveX script using DTS Designer?

Thanks in advance for your valuable inputs.

Paul

"Allan Mitchell" wrote:

Quote:
OK

DTS does not have the know how to be thrown some files and just import
them in the right order.

Personally I would

Import the file into a staging/working table
Using TSQL grab the columns from this table that go into the master
table
Grab the columns that go into the Child table
After importing the Master table rows(columns)
You keep the mapping between the Master table and the working table so
that you know with what ID to tag the child records when entering them.

Allan

"paul2010" <paul2010 (AT) discussions (DOT) microsoft.com> wrote in message
newsaul2010 (AT) discussions (DOT) microsoft.com:
Hi,

I have a small project in which I have to import fields from a csv/xls
file
and map it
to multiple tables within a database ensuring field validations and
referential integrity between tables, i.e. Insert/Update per the
Parent-Child relationships.

I have been reviewing DTS Designer info but unable to come up with a
conclusion whether I can successfully do it and if yes then is there any

sample code for similar task.

I need some help in this area and it is kind of urgent. Any tips/leads in

this regards would really appreciated.

I would welcome e-mail or phone response.

Thanks,

Paul
Atlanta, GA
706-315-5956



Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Mapping Single Source Data to Multiple Tables - 02-15-2005 , 03:30 PM



You can read this information from the system catalog views
(INFORMATION_SCHEMA.* )but you would then need to interpret this as
well.

If you know the data is clean (or clean it first) you can remove the
constraints. Blow the data in. Re-Enable the constraints.

Allan

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

Quote:
Allan,

Thanks for your tips. I understand the logic behind staging table and then

populating Master and Child table.

My question is that I have at least 8-10 destination tables and they are

related via FKs with no one table acts a Master table. Is there a way
within
DTS to read schema from my database and identify PK and FKs and popolute
the
Master and Children tables accordingly from the a single source table? Or
do
I have to write a complex ActiveX script using DTS Designer?

Thanks in advance for your valuable inputs.

Paul

"Allan Mitchell" wrote:

OK

DTS does not have the know how to be thrown some files and just import

them in the right order.

Personally I would

Import the file into a staging/working table
Using TSQL grab the columns from this table that go into the master
table
Grab the columns that go into the Child table
After importing the Master table rows(columns)
You keep the mapping between the Master table and the working table so

that you know with what ID to tag the child records when entering
them.

Allan

"paul2010" <paul2010 (AT) discussions (DOT) microsoft.com> wrote in message
newsaul2010 (AT) discussions (DOT) microsoft.com:
Hi,

I have a small project in which I have to import fields from a
csv/xls
file
and map it
to multiple tables within a database ensuring field validations and
referential integrity between tables, i.e. Insert/Update per the
Parent-Child relationships.

I have been reviewing DTS Designer info but unable to come up with a
conclusion whether I can successfully do it and if yes then is there
any

sample code for similar task.

I need some help in this area and it is kind of urgent. Any tips/leads
in

this regards would really appreciated.

I would welcome e-mail or phone response.

Thanks,

Paul
Atlanta, GA
706-315-5956




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.