在调试期间观察 SSIS 中的变量
我在 SSIS 中有一个项目,并且添加了一个执行 SQL 任务,该任务将其结果发送到变量。 我想确认该值,因为我担心它会尝试将其写为结果集对象而不是实际的整数(在本例中我返回一个 COUNT)。
我的第一个想法是在调试模式下运行它并将全局变量添加到我的监视窗口中。 不幸的是,当我右键单击“监视”窗口时,“添加变量”选项呈灰色。 我在这里缺少什么?
我已经设法确认我的变量设置是否正确,所以我对诸如将脚本放入带有值或类似内容的 MsgBox 之类的方法不感兴趣。 为了将来的参考,我希望能够在调试模式下观察变量。 如果有某种限制,那么我想知道这一切的内容和原因(如果有人知道的话)。
遗憾的是,这方面的帮助远远不够,我能找到的每一个“教程”都只是说“将变量添加到“监视”窗口并进行调试”,好像这样做永远不会有问题。
感谢您的任何见解!
I have a project in SSIS and I've added an Execute SQL Task which sends its result out to a variable. I wanted to confirm the value because I was worried that it would try to write it out as a resultset object rather than an actual integer (in this case I'm returning a COUNT).
My first thought was just to run it in debug mode and add the global variable to my Watch window. Unfortunately, when I right-click on the Watch window, the option to "Add Variable" is greyed out. What am I missing here?
I've gotten around confirming that my variable is set correctly, so I'm not interested in methods like putting a script in to do a MsgBox with the value or anything like that. For future reference I'd like to be able to watch variables in debug mode. If there are some kind of constraints on that then I'd like to know the what and why of it all if anyone knows.
The help is woefully inadequate on this one and every "tutorial" that I can find just says, "Add the variable to the Watch window and debug" as though there should never be a problem doing that.
Thanks for any insight!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我相信您只能在调试器停止在断点上时将变量添加到“监视”窗口。 如果在步骤上设置断点,则在命中断点时,您应该能够在“监视”窗口中输入变量。 您可以选择“监视”窗口中的第一个空行并输入变量名称(您可能会或可能不会在那里获得一些智能感知,我不记得它的效果如何。)
I believe you can only add variables to the Watch window while the debugger is stopped on a breakpoint. If you set a breakpoint on a step, you should be able to enter variables into the Watch window when the breakpoint is hit. You can select the first empty row in the Watch window and enter the variable name (you may or may not get some Intellisense there, I can't remember how well that works.)
将变量从“变量”窗格拖动到“监视”窗格,瞧!
Drag the variable from Variables pane to Watch pane and voila!
我知道这是非常旧的,可能正在谈论旧版本的 Visual Studio,因此这之前可能不是一个选项,但无论如何,我的方法是在断点时使用局部窗口查看所有当前变量值( Debug > ;> 本地 )
I know this is very old and possibly talking about an older version of Visual studio and so this might not have been an option before but anyway, my way would be when at a breakpoint use the locals window to see all current variable values ( Debug >> Windows >> Locals )
Visual Studio 2013:对于在调试期间添加到监视窗口以及拖动变量或在不使用“user::”的情况下键入变量的情况,选择“是”。 但在这一切起作用之前,我还需要转到“工具”>“工具”>“工具”。 选项,然后调试> 一般,必须向右滚动到右侧窗格的底部才能勾选“使用托管兼容模式”。 然后我不得不停止并重新启动调试。 最后,上述建议奏效了。 非常感谢上述内容和本文: Visual Studio 2015 调试:可以不扩展局部变量?
Visual Studio 2013: Yes to both adding to the watch windows during debugging and dragging variables or typing them in without "user::". But before any of that would work I also needed to go to Tools > Options, then Debugging > General and had to scroll right down to the bottom of the right hand pane to be able to tick "Use Managed Compatibility Mode". Then I had to stop and restart debugging. Finally the above advice worked. Many thanks to the above and to this article: Visual Studio 2015 Debugging: Can't expand local variables?