Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm writing an ssis package that imports a number of access databases nightly. Each database has the potential to have a slightly different schema. Since I'm creating the tables than doing a direct table insert using execute sql tasks inside of a for each loop container the schema differences cause errors. I've upped the max error count so that the package can take errors and continue running. This leaves me with some databases that have incomplete data which I would prefer to drop.

I attempted to make an event handler that would drop the database; however, at the point that the event handler is called the database is still in use. Is there another way that I could drop the database if there is an error?

share|improve this question
1  
Without knowing much about your package architecture, it seems like you can run the ForEach Loop container in a transaction: msdn.microsoft.com/en-us/library/ms141724.aspx –  zlatan May 21 '12 at 16:35
add comment

1 Answer

Not 100% sure what you are attempting here, but you could record the names of "partial" databases in a table in SQL and then run a separate process after the fact to drop them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.