|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Have a problem importing a text file into a sql server db. Basically i need to code a dts that will use an active x script when importing one column of the of the text file. If this column has a input of 1 or 3 then the next column should be input into the next field in the db. If this column has an input of 2 then i need to insert the next column by skipping the next field in the db. Any ideas? |
|
#2
|
||||
|
||||
|
Isn't it simpler (and faster) to load everything in the db with a basic DTS and then use TSQL to accomplish the select/insert?
|
|
#3
|
|||
|
|||
|
Unfourtunetly the data has to be entered into certain fields upon importing the text file as it will be automated...here is the active x script in sql
'********************************************************************** ' Visual Basic Transformation Script '************************************************************************ ' Copy each source column to the destination column Function Main() DTSDestination("TypeFlag") = DTSSource("Col002") Main = DTSTransformStat_OK End Function basically if DTSSource("Col002") - 1 or 3 the next text column should be entered into the next db field (say the 3rd field)....if DTSSource("Col002") = 2 then the next column should be entered into the 4the db field skipping the 3rd one!!confused??i am!!! thanks for your reply! |
|
#4
|
||||
|
||||
|
I got your point, mine was that it's easier (and faster AFAIK) to load the file unchanged in a "service" table and then build a TSQL procedure to extract data.
This can be easily automated and scheduled. |
|
#5
|
|||
|
|||
|
dts
yeah i know what you mean tragically i have to doo it this way!!any ideas??
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Sql Server Dts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|