在 SQL Server Management Studio 中将存储过程作为作业运行
我正在尝试在作业中运行存储过程,这就是作业设置的命令框中的内容。
EXEC“sp_uss_Hi-Valley_Chemical”
报告设置为TSQL。
它给了我“Valley_Chemical”附近语法不正确的错误。我只是输入了“”(引号),但它仍然给我同样的错误。
非常感谢任何帮助。
I am trying to run a stored procedure in a job, and this is what i have in the command box on the job setup.
EXEC "sp_uss_Hi-Valley_Chemical"
the report is set as TSQL.
it gives me the error incorrect syntax near 'Valley_Chemical'. I just put in " " (quotes) and it is still giving me the same error.
any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试在过程名称两边加上方括号:
Try throwing square brackets around the proc name:
破折号不是存储过程名称的有效字符。这就是它抛出错误的原因。以下是有关允许的内容的 Microsoft 文档的链接:
http://msdn.microsoft.com/en-我们/库/ms175874(v=SQL.105).aspx
The dash is not a valid character for a stored procedure name. That is why it is throwing the error. Here is a link to Microsoft's documentation on what is allowed:
http://msdn.microsoft.com/en-us/library/ms175874(v=SQL.105).aspx
将过程名称括在方括号中。
另外,过程名称不应以“sp_”开头。请参阅:使用“sp_”前缀的存储过程性能 – 神话还是事实?
Enclose the name of the procedure in square brackets.
Also, you should not start procedure names with "sp_". See: Stored Procedure performance using “sp_” prefix – Myth or fact?