我在 SSIS 中使用 foreach 循环来遍历文件夹的内容,为每个文件执行 SQL 任务。
当我这样做时,它在循环的前约 300 次工作正常,然后它挂起并说:
Error: 0xC002F210 at ______, Execute SQL Task: Executing the query "[__].[dbo].[_______]"
failed with the following error: "Timeout expired. The timeout period elapsed prior to
obtaining a connection from the pool. This may have occurred because all pooled connections
were in use and max pool size was reached.". Possible failure reasons: Problems with the
query, "ResultSet" property not set correctly, parameters not set correctly, or connection not
established correctly.
我想这意味着旧任务关闭得太慢了?真正的问题是,如果我在失败的任务之前添加另一个 SQL 任务(将空白字符串插入 tmp 表,使用相同的连接) ,那么整个事情就会正常工作。不过,这不是一个好的解决方案,我希望弄清楚是否有已知的解决方法,或者我是否在做一些非常愚蠢的事情。