在查询分析器里可用,但在作业里报错

boombacn 2008-11-18 12:01:54
就下面这个句子,在查询分析器里运行的时候没有错误,但在作业里报:
错误208,对象名"tc_customer"无效,"tc_customer"无效
达人帮忙看看

update tc_customer set tc_customer.cust_dec002 = aa.yea from tc_customer ,
(select tc_customer.friend_id,datediff(year,convert(datetime,substring(tc_customer.cust_char004,1,10)),getdate()) yea
from tc_customer
where isdate(substring(cust_char004,1,10)) = 1) as aa


where tc_customer.friend_id = aa.friend_id
and tc_customer.owner_id = 1
...全文
82 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
boombacn 2008-11-18
  • 打赏
  • 举报
回复
得解,谢楼上,前面加usb db后解决
zjcxc 2008-11-18
  • 打赏
  • 举报
回复
可能的原因;
1. 在作业的步骤中, 你没有选对数据库(作业是在 msdb 中, 一定要在作业步骤中选择你的表所在的库)
2. 权限问题, 检查你的作业所有者, 建议改成 sa

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧