简体   繁体   English

当存储过程更改时,为什么OLE DB数据源不更新元数据?

[英]Why won't an OLE DB data source update metadata when the stored procedure changes?

I am calling a stored procedure from an OLE DB data source in SSIS. 我正在从SSIS中的OLE DB数据源调用存储过程。 Why doesn't SSIS see changes I have made to the stored procedure? SSIS为什么看不到我对存储过程所做的更改? It seems like metadata about the stored procedure is cached somewhere. 似乎有关存储过程的元数据被缓存在某个地方。 Is it cached? 缓存了吗? If so how do I force SSIS to see the changes I made to the stored procedure? 如果是这样,如何强制SSIS查看对存储过程所做的更改?

It's possible the problem isn't that SSIS isn't seeing your changes; 问题可能不是SSIS没有看到您的更改;而是SSIS没有看到您的更改。 but rather that what you're changing isn't visible to SSIS. 而是您所做的更改对SSIS不可见。

To clarify that very confusing answer, try this: drag an OLE DB data source onto some data flow. 若要弄清这个非常令人困惑的答案,请尝试以下操作:将OLE DB数据源拖到某些数据流上。 Hook it up to the same stored procedure, with the same parameters, etc. Check the metadata for the output columns. 将其连接到具有相同参数等的相同存储过程。检查输出列的元数据。

If they are what you expected, then the problem is SSIS not seeing your changes. 如果它们是您期望的,那么问题在于SSIS没有看到您的更改。 I'll be surprised if this is the answer - if anything, SSIS is too picky about seeing changes in metadata (especially in the 2005 version). 如果这是答案,我会感到惊讶-如果有的话,SSIS对于看到元数据的更改(特别是在2005版本中) 挑剔。

If you're not seeing the metadata you expected, then you'll have to edit your post with more detail on your stored procedure. 如果没有看到所需的元数据,则必须编辑有关存储过程的更多详细信息。 But I can say in general that neither SSIS nor any other piece of software can determine the shape of your resultset in all cases. 但总的来说,我可以说SSIS或任何其他软件都无法确定结果集的形状。 I believe they use the SET FMTONLY command to arrange that queries "don't really" execute. 我相信他们使用SET FMTONLY命令来安排“不是真的”查询的执行。 Instead, they are passed NULL for all their parameters. 而是将所有参数传递给NULL。 The result set that occurs when all your parameters are NULL or default values is the one that SSIS will see. 当所有参数均为NULL或默认值时出现的结果集就是SSIS将看到的结果集。 If you have a complicated SP that returns result sets of different shapes based on input, then this could be the problem. 如果您有一个复杂的SP,它根据输入返回不同形状的结果集,则可能是问题所在。

To regenerate the metadata, simply delete the flow pipe (red and green), and re-add them. 要重新生成元数据,只需删除流管道(红色和绿色),然后重新添加它们即可。 This is the easiest solution I have found to this problem. 这是我找到的最简单的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM