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

Need to implement the Business rule row by row Expand / Collapse
Author
Message
Posted Monday, September 10, 2012 10:14 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:22 AM
Points: 280, Visits: 1,212
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.. ?


Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
Post #1357127
Posted Wednesday, September 12, 2012 1:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 13, 2014 7:34 AM
Points: 117, Visits: 499
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
Post #1357826
Posted Wednesday, September 12, 2012 4:30 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:22 AM
Points: 280, Visits: 1,212
Yes, I decided to make as Sp and calling directly from Import tool...

Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
Post #1357880
Posted Wednesday, September 12, 2012 8:42 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:40 AM
Points: 35,265, Visits: 31,754
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1358305
Posted Thursday, September 13, 2012 10:56 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:22 AM
Points: 280, Visits: 1,212
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 ..

Many Thanks!
S.saravanan
“I am a slow walker, but I never walk backwards-
Abraham Lincoln”
Post #1359041
Posted Friday, September 14, 2012 8:00 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:14 PM
Points: 13,007, Visits: 12,425
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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1359296
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse