![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a CSV file like this: "fieldValue1","fieldValue2","fieldValue3","fieldVa lue4" I'd like to create a DTS package which dose the following operation on the CSV file: 1) Inserts "fieldValue1" into **Table1**.field1 2) Inserts "fieldValue2" into **Table2**.field2 1) Inserts "fieldValue3" into **Table3**.field3 1) Inserts "fieldValue4" into **Table4**.field4 So as you can see dts package should be able to insert different fieldValues into different Tables in one database. Is it possible to Implement such a thing in DTS? Thanks for your help. Ali-R |
#3
| |||
| |||
|
|
In message <#6q4lmSGFHA.2932 (AT) TK2MSFTNGP10 (DOT) phx.gbl>, Ali-R AliR (AT) microsft (DOT) com> writes I have a CSV file like this: "fieldValue1","fieldValue2","fieldValue3","fieldVa lue4" I'd like to create a DTS package which dose the following operation on the CSV file: 1) Inserts "fieldValue1" into **Table1**.field1 2) Inserts "fieldValue2" into **Table2**.field2 1) Inserts "fieldValue3" into **Table3**.field3 1) Inserts "fieldValue4" into **Table4**.field4 So as you can see dts package should be able to insert different fieldValues into different Tables in one database. Is it possible to Implement such a thing in DTS? Thanks for your help. Ali-R You could do this with the Data Pump Task. You do not have to insert data into the destination, and by using an ActiveX Script Transform your could call a lookup for each row. Lookups can be any T-SQL you like and not even return anything, so make the lookup call a stored procedure, passing in all the source (column) values and insert them into the correct tables. It may be faster to just insert the data into a staging table and write some T-SQL to INSERT...SELECT the values into the correct table. Call this via a T-SQL task after the Data Flow. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#4
| |||
| |||
|
|
I didn't get what yuo mean by lookup calls,can you provide more explanation ,please? Thanks for your help. "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:+k0MvQCj86GCFwmP (AT) sqldts (DOT) com... In message <#6q4lmSGFHA.2932 (AT) TK2MSFTNGP10 (DOT) phx.gbl>, Ali-R AliR (AT) microsft (DOT) com> writes I have a CSV file like this: "fieldValue1","fieldValue2","fieldValue3","fieldVa lue4" I'd like to create a DTS package which dose the following operation on the CSV file: 1) Inserts "fieldValue1" into **Table1**.field1 2) Inserts "fieldValue2" into **Table2**.field2 1) Inserts "fieldValue3" into **Table3**.field3 1) Inserts "fieldValue4" into **Table4**.field4 So as you can see dts package should be able to insert different fieldValues into different Tables in one database. Is it possible to Implement such a thing in DTS? Thanks for your help. Ali-R You could do this with the Data Pump Task. You do not have to insert data into the destination, and by using an ActiveX Script Transform your could call a lookup for each row. Lookups can be any T-SQL you like and not even return anything, so make the lookup call a stored procedure, passing in all the source (column) values and insert them into the correct tables. It may be faster to just insert the data into a staging table and write some T-SQL to INSERT...SELECT the values into the correct table. Call this via a T-SQL task after the Data Flow. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
![]() |
| Thread Tools | |
| Display Modes | |
| |