Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


handling row length in SSIS


handling row length in SSIS

Author
Message
Vladimir Kievsky-369224
Vladimir Kievsky-369224
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 58
I have created a SSIS package in BIDS for loading data from text file. I have bad rows where the last column is absent, and I need to reject those. The rows supposedly should have fixed length, and the way to solve this, as I see it, is to redirect rows to good/bad destinations based on row length.<script></script>
I see nothing in BIDS data flow components expressions or system variables handling row lenth. So come a Script task. I saw the Row object in samples of VB.Net scipts, and it has size property, which may be a solution.
Can you help with a sample of routine doing that? Also, is there any web site with a good reference to all VB.Net classes, their methods and properties?

Thanks in advnce
Vladimir Kievsky
Bill McDonough
Bill McDonough
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 99

One way to do this is a script task. In the script, you'll have something like this:

Public Overrides Sub ProcessInputRow(ByVal Row as rowInBuffer)

In that function, you can use this to get or test row length:

Row.FullRow.Length

Hope this helps.

Bill


Vladimir Kievsky-369224
Vladimir Kievsky-369224
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 58

Thanks. I was able to go by using RaggedRight. Still, it was tricky: I needed to set row delimiter, it is a property without value by default.


sankar.krish
sankar.krish
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 59
Have considered using Len function in ssis ? Just curious .
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8320 Visits: 19470
Bill McDonough (2/2/2007)


One way to do this is a script task. In the script, you'll have something like this:

PublicOverrides Sub ProcessInputRow(ByVal Row as rowInBuffer)

In that function, you can usethis toget or test row length:

Row.FullRow.Length

Hope this helps.

Bill


You are referring to a Script Component. Script Tasks are valid only in control flows.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search