dbTalk Databases Forums  

How Do You Dynamically Control The Record Length?

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


Discuss How Do You Dynamically Control The Record Length? in the microsoft.public.sqlserver.dts forum.



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

Default How Do You Dynamically Control The Record Length? - 11-19-2004 , 11:15 AM






I have a Text File (Source) Connection object. I need to dynamically control
the Record Length to properly read some non-standard CSV files.

When you use the Text File Properties dialog and specify a Row Delimiter of
NONE you have to also specify the Record Length.

I need to specify the Record Length value dynamically. I cannot find the
property option for this value.

Could use some help here.

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

Default Re: How Do You Dynamically Control The Record Length? - 11-20-2004 , 01:23 AM






If I get what you mean then does this work?

Function Main()


dim cn

set cn = DTSGlobalVariables.Parent.Connections("Text File (Source)")

cn.ConnectionProperties("Column Lengths").Value = 4


Main = DTSTaskExecResult_Success
End Function

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a Text File (Source) Connection object. I need to dynamically control
the Record Length to properly read some non-standard CSV files.

When you use the Text File Properties dialog and specify a Row Delimiter of
NONE you have to also specify the Record Length.

I need to specify the Record Length value dynamically. I cannot find the
property option for this value.

Could use some help here.



Reply With Quote
  #3  
Old   
Jamie Carper
 
Posts: n/a

Default Re: How Do You Dynamically Control The Record Length? - 11-23-2004 , 09:29 AM



Hi Allan,

If you drop a Text File (Source) Object and then access the Text File
Properties dialog. If you select "Fixed Field Information" with a Row
Delimiter of "<None>" you then have to specify the length of the row. There
is an option in the Dialog box to do so when you click Next. However I
cannot find it's equivalent in the Object's properties for programming
purposes.

Jamie

"Allan Mitchell" wrote:

Quote:
If I get what you mean then does this work?

Function Main()


dim cn

set cn = DTSGlobalVariables.Parent.Connections("Text File (Source)")

cn.ConnectionProperties("Column Lengths").Value = 4


Main = DTSTaskExecResult_Success
End Function

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Jamie Carper" <JamieCarper (AT) discussions (DOT) microsoft.com> wrote

I have a Text File (Source) Connection object. I need to dynamically control
the Record Length to properly read some non-standard CSV files.

When you use the Text File Properties dialog and specify a Row Delimiter of
NONE you have to also specify the Record Length.

I need to specify the Record Length value dynamically. I cannot find the
property option for this value.

Could use some help here.




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.