SQL 作业和存储过程
我有一个存储过程,它将从接收位置选取 MQ 文件,对其进行处理并将其放入保存位置。
目前,当我手动执行此存储过程时,它不起作用。
但是,文件会在每天的特定时间自动拾取并保存在保存位置。 我不知道哪个存储过程需要这个。
有一个 SQL Server 作业每天在这个特定时间设置。 这项工作正在调用与我手动调用的相同的存储过程。
当我尝试手动运行 SQL 作业时,未拾取文件。
MQ 中是否有任何机制来选择文件并将其放入接收位置?
I have a stored procedure which will pick MQ files from receive location, process it and drop it in save location.
Currently, this stored procedure is not working when I execute it manually.
But files are picked up and saved in the save location automatically at a particular time of day daily. I don't know which stored procedure is calling for this.
There is a SQL Server job which is set up daily at this particular time. This job is calling the same stored procedure which i call manually.
When I try to run the SQL job manually the files are not picked up.
Will be there any mechanism in MQ to pick the files and drop it in receive location?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最初的猜测是:域访问权限。 当 SQL 代理调用该过程时,它在“运行”SQL 代理服务的帐户的权限(域访问权限)下运行。 此帐户对您正在访问的文件夹具有适当的访问权限。
当您登录并调用该过程时,它将在您的访问权限下运行,并且您可能没有足够的权限访问这些目标文件夹来执行列出的工作。
它可能比这更复杂。 一旦您离开简单的数据库操作领域并开始使用 SQL 来扰乱您的网络,您就必须处理一个充满代理帐户和晦涩功能的世界。 它可以而且已经做到了,但配置起来并不简单。 很大程度上取决于您(好吧,代码)的实现方式。
My initial guess is: domain access rights. When the procedure is called by SQL Agent, it is being run under the authority (domain access rights) of the account that is "running" the SQL Agent service. This account has the proper access rights to the folders you are accessing.
When you log on and call the procedure, it is being run under your access rights, and you may not have sufficient rights on those targeted folders to do the work listed.
It could be more complex than that. Once you leave the realm of simple database operation and start using SQL to mess about on your network, there's a world of proxy accounts and obscure features that you have to deal with. It can and has been done, but it's rarely simple to configure. A lot depends on how you (well, the code) has been implemented.