SSIS: database xyz cannot be opened. It is in the middle of a restore

蓝咒 提交于 2019-12-24 07:59:02

问题


In SSIS 2008, is there is way to design an SSIS package around the problem when an OLE DB data source returns an error like this "Database [xyz] cannot be opened. It is in the middle of restore."?

I am hoping there is a way to design a loop into an SSIS 2008 package to trap this error, maybe wait 5 or 10 minutes for the source DB to finish restoring (from log shipping for example) and then try again - with a max retry limit built in.

Thank You.


回答1:


Yes. When you connect, don't connect to your database. Use master, say, in a different connection object.

Then, query the state column in sys.databases. If not 0, wait for a bit, try again.



来源:https://stackoverflow.com/questions/5236712/ssis-database-xyz-cannot-be-opened-it-is-in-the-middle-of-a-restore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!