Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 cursors

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2011-07-07 : 07:37:37
My stored proc has two cursors i.e. cursor1 does a select and cursor 2 is within cursor 1.
How can this be implemented in ssis please?
Please note that for business requirements the stored proc has to be the way it is and the same thing has to be implemented in ssis.
Thank you

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-07-07 : 07:43:07
Maybe get the data from cursor 1 into an object then loop through the rows populating another object with the result of the second cursor.

It's an odd business requirement that says how a function should be implemented - I would ask whoever gave the requirement how it should be coded as they obviously know what they were expecting.
Not many developers would accept a requirement like this - I suspect there's a fast staff turnover.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-07-07 : 08:09:59
quote:
Please note that for business requirements the stored proc has to be the way it is and the same thing has to be implemented in ssis.
So the business requirement actually says "this must be done in the slowest and most ass-backward way possible?"

I'm not making fun of you, but that's what's being asked here.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-07-07 : 08:24:34
You can execute the stored proc in the SSIS package.

And I doubt that nested cursors are a business requirement. Unless your company sells nested cursors...
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-07 : 09:40:03
quote:
Originally posted by russell

You can execute the stored proc in the SSIS package.

And I doubt that nested cursors are a business requirement. Unless your company sells expensive nested cursors...




No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2011-07-07 : 09:43:25
I know what ou are saying but this is how it is at present in the SP and the manager is happy with it and he says it should not be changed.
Thanks
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-07-07 : 10:06:22
That's easy then - don't change it. Don't understand what the question is - you have code that your manager is happy with and doesn't want changed, why are you trying to change it without changing it?

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -