Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Sunday, March 11, 2012

Backwards in a foreach for ADO?

I need to simulate cursor-type (groan) behavior in a dataset and am wondering if this is possible in the foreach task. Example - The user has the need to go through the data row-by-row, and if a certain value is missing in row 10 then go back to row 8, grab a value from that row, and plug it in the missing column in row 10. Then move on to row 11.

Is there a way to make the foreach ADO enumerator travel backwards? Is there a way to do this that will not be awfully inefficient? Any suggestions out there would be welcome.

I've advocated for set-based updates, and these simply aren't an option, as each successive row depends on the updates that may have happened above it in the sequence. Unless I hear of any other ideas out there I have to move forward with this sequential type operation.

This sounds like a script task to me... I don't believe that there is an effecient way to do this (if at all) with a for each loop...

|||

That's the headache I'm having - I don't see a good way to do this period, from a SQL/SSIS/relational perspective.

|||Not sure if this would meet your needs, but you can use a script transform to buffer rows. You'd have to create some structure to store the data in (an array or dataset would work) and then you can access the rows in any order you wish.|||

Sounds intriguing - do you happen to have an example handy?

Thursday, March 8, 2012

Backups running concurrently with db maintenance

I have a db maintenance task that I think will take many hours (reindexing a
rather large table with several millian rows). Can I run this concurrently
with the backup (full)?
Further to this, is there a list of tasks that can and can't be run at the
same time as a backup?
You can run the reindexing concurrently with the database backup, but they
will most likely slow each other down.
There is nothing that you can not run concurrently with a backup, in the
sense that the process will fail. In general though it is not really
advisable to schedule other tasks concurrently with a back up, as you don't
gain a lot in the combined processing time in general (if at all).
Jacco Schalkwijk
SQL Server MVP
"Branth" <Branth@.discussions.microsoft.com> wrote in message
news:996B0F0F-F11A-4DE6-9605-14C91F560400@.microsoft.com...
>I have a db maintenance task that I think will take many hours (reindexing
>a
> rather large table with several millian rows). Can I run this
> concurrently
> with the backup (full)?
> Further to this, is there a list of tasks that can and can't be run at the
> same time as a backup?
>

Backups running concurrently with db maintenance

I have a db maintenance task that I think will take many hours (reindexing a
rather large table with several millian rows). Can I run this concurrently
with the backup (full)?
Further to this, is there a list of tasks that can and can't be run at the
same time as a backup?You can run the reindexing concurrently with the database backup, but they
will most likely slow each other down.
There is nothing that you can not run concurrently with a backup, in the
sense that the process will fail. In general though it is not really
advisable to schedule other tasks concurrently with a back up, as you don't
gain a lot in the combined processing time in general (if at all).
--
Jacco Schalkwijk
SQL Server MVP
"Branth" <Branth@.discussions.microsoft.com> wrote in message
news:996B0F0F-F11A-4DE6-9605-14C91F560400@.microsoft.com...
>I have a db maintenance task that I think will take many hours (reindexing
>a
> rather large table with several millian rows). Can I run this
> concurrently
> with the backup (full)?
> Further to this, is there a list of tasks that can and can't be run at the
> same time as a backup?
>

Backups running concurrently with db maintenance

I have a db maintenance task that I think will take many hours (reindexing a
rather large table with several millian rows). Can I run this concurrently
with the backup (full)?
Further to this, is there a list of tasks that can and can't be run at the
same time as a backup?You can run the reindexing concurrently with the database backup, but they
will most likely slow each other down.
There is nothing that you can not run concurrently with a backup, in the
sense that the process will fail. In general though it is not really
advisable to schedule other tasks concurrently with a back up, as you don't
gain a lot in the combined processing time in general (if at all).
Jacco Schalkwijk
SQL Server MVP
"Branth" <Branth@.discussions.microsoft.com> wrote in message
news:996B0F0F-F11A-4DE6-9605-14C91F560400@.microsoft.com...
>I have a db maintenance task that I think will take many hours (reindexing
>a
> rather large table with several millian rows). Can I run this
> concurrently
> with the backup (full)?
> Further to this, is there a list of tasks that can and can't be run at the
> same time as a backup?
>