简体   繁体   中英

SSIS - Conditional Split when rows are not null

I have .xlsx sheet where data starts from A1:AB199 . I am trying to extract data from Row A6:AB48 and ignore the rest.

Started creating a Conditional Split so SSIS package can start from Row A6 and end at Row AB48 but failing. Please guide

Try this, In your Data Flow task, you will need to set the "OpenRowset" Custom Property of your Excel Connection

Or

Another MSDN Link

1 - Excel Source -> Variables -> In Data Access Mode select "Table name or view name variable" 2- In the variable name select a variable that you had made before "MyVar" 3- Go To variable select "MyVar" and type "TabName$A12:H125"

  • Before conditional split add a script component with one output column of type DT_BOOL . In my example i assume that is named OutColumn .

  • In the script window add the following Code:

     Private m_intRowCounter as integer = 0 Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) m_intRowCounter += 1 if m_intRowCounter >= 6 Row.OutCOlumn = True Else Row.OutCOlumn = False End If End Sub 
  • In the conditional split split row on OutColumn : if true take rows to destination

Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM