Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

handling row length in SSIS Expand / Collapse
Author
Message
Posted Thursday, February 1, 2007 6:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 13, 2013 9:50 AM
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
Post #341606
Posted Friday, February 2, 2007 7:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 2:47 PM
Points: 2, Visits: 98

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

 

 

Post #342029
Posted Saturday, February 3, 2007 10:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 13, 2013 9:50 AM
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.

 

Post #342295
Posted Tuesday, July 23, 2013 12:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 6:25 AM
Points: 1, Visits: 59
Have considered using Len function in ssis ? Just curious .
Post #1476357
Posted Monday, July 29, 2013 3:22 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 1:50 AM
Points: 4,986, Visits: 11,684
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1478493
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse