SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need to implement the Business rule row by row


Need to implement the Business rule row by row

Author
Message
Saravanan_tvr
Saravanan_tvr
SSC Eights!
SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)

Group: General Forum Members
Points: 862 Visits: 1354
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”
Mackers
Mackers
SSChasing Mays
SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)

Group: General Forum Members
Points: 651 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 :-D

Mack
Saravanan_tvr
Saravanan_tvr
SSC Eights!
SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)

Group: General Forum Members
Points: 862 Visits: 1354
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”
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)SSC Guru (206K reputation)

Group: General Forum Members
Points: 206335 Visits: 41955
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Saravanan_tvr
Saravanan_tvr
SSC Eights!
SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)SSC Eights! (862 reputation)

Group: General Forum Members
Points: 862 Visits: 1354
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”
Sean Lange
Sean Lange
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59908 Visits: 17947
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.

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)
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