dbTalk Databases Forums  

single DTS for changing text file(column number changes)

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


Discuss single DTS for changing text file(column number changes) in the microsoft.public.sqlserver.dts forum.



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

Default single DTS for changing text file(column number changes) - 07-20-2003 , 10:32 PM






I have a dts package which takes input as text file name(
from global variable) and then transfer the data to a
table.I run this dts package from c# program by assigning
different file name. Each time it loads to the same table.

The new requirement has come. The input file is a
tabdelimited file. Normally it has 4 coulmn fields. But in
some case it may have 6 column fields.

In current approch I am mapping the file column field to
database column field.

Is there a way to transfer data to database-
1. if tab delimited file does not have additional field
insert null in those field to database table
2. if additional filed are present pass all the data to
database.

currently if a make a dts with total text file field 6 and
map it to database table with field, It is working fine
only if input text file has 6 column. If it has only 4
column it gives error saying (rest two field not present)


How can I resolve the issue within DTS.
I will appreciate any help.

thanks
raj

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

Default Re: single DTS for changing text file(column number changes) - 07-21-2003 , 02:09 AM






Why do you not set up two datapump tasks (1 for width = 4 and 1 for width =
6). Test the file in an AX Script before the datapumps and after
ddetermining the format enable the correct pump , disable the other using
workflow.

Multiple Paths in Workflow
http://www.sqldts.com/default.aspx?6,103,218,7,1

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"rajesh" <rajesh_1999 (AT) yahoo (DOT) com> wrote

Quote:
I have a dts package which takes input as text file name(
from global variable) and then transfer the data to a
table.I run this dts package from c# program by assigning
different file name. Each time it loads to the same table.

The new requirement has come. The input file is a
tabdelimited file. Normally it has 4 coulmn fields. But in
some case it may have 6 column fields.

In current approch I am mapping the file column field to
database column field.

Is there a way to transfer data to database-
1. if tab delimited file does not have additional field
insert null in those field to database table
2. if additional filed are present pass all the data to
database.

currently if a make a dts with total text file field 6 and
map it to database table with field, It is working fine
only if input text file has 6 column. If it has only 4
column it gives error saying (rest two field not present)


How can I resolve the issue within DTS.
I will appreciate any help.

thanks
raj



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.