如何解决在 T-SQL 语句任务中运行 EXEC 过程时出错
我创建了几个想要使用维护计划的 Execute T-SQL Statement Task
框运行的程序,但是我收到了找不到作业的错误消息。
运行 EXEC [dbo].[sp_backup_full] N'db_name',N'path/where//to/store/backup'
时返回错误:
End Progress Error: 2021-06-29 18:59:00.42 Code: 0xC002F210 Source: full_backup_and_delete_old_one Execute SQL Task
Description: Executing the query "EXEC [dbo].[sp_backup_full] N'db_name..." failed with the following error: "Could not find stored procedure 'dbo.sp_backup_full'.".
Possible failure reasons: Problems with the query,"ResultSet" property not set correctly,parameters not set correctly,or connection not established correctly.
解决方法
如果不指定databasename,则默认在master
数据库中运行。您可以为存储过程调用提供三部分名称,以确保它使用正确的数据库来执行。
EXEC [DatabaseName].[dbo].[sp_backup_full]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。