![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 news aul2010 (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 |
#4
| |||
| |||
|
|
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 news aul2010 (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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |