Need to implement the Business rule row by row

  • Hi,

    How can we agonize,Row by row like cursor in SSIS, what controls will be using,

    Here am reading data from excel , now I want to apply all client business logic's one row at a time, once completed i want to move second row..

    Please let me know how can i perform.. ?

  • What sort of thing are you trying to do? Depending on the size row by row updates could be slow

    I guess you have a few options but I think if the business logic is complicated I'd be tempted to dump the data into a staging table then run a stored proc

    The other option would be to use a script component in the data flow

    If the logic is simple (eg first three characters of a column) then I guess you could use a derived column in SSIS or a slow option could be puting a SQL function on the import table 😀

    Mack

  • Yes, I decided to make as Sp and calling directly from Import tool...

  • Saravanan_tvr (9/10/2012)


    now I want to apply all client business logic's one row at a time, once completed i want to move second row..

    Yes, I decided to make as Sp and calling directly from Import tool...

    Did you end up using somme form of loop for this? If so, this is going to be much slower than writing a set based validation routine. Why are you insisting on the use of RBAR?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Yes, We have a cross validations with 10 Master table then Update and Insertions based on the Logic. from excel one row at a time. as per the client requirements ..

  • Saravanan_tvr (9/13/2012)


    Yes, We have a cross validations with 10 Master table then Update and Insertions based on the Logic. from excel one row at a time. as per the client requirements ..

    That does not sound like a reason to this RBAR. You can do all that using MERGE and OUTPUT.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply