我试图创建一个执行此命令的 SQL Server 代理任务:
use PPTEST
Update PPTEST.dbo.T_AUAU
SET PPTEST.dbo.T_AUAU.auaulart = auli.auliart
From PPTEST.dbo.T_AUAU auau
INNER JOIN
PPTEST.dbo.T_AULI auli
on
auau.auauaunr = auli.auliaunr
where CONVERT(date, LEFT(auli.timest, 10 )) >= CONVERT(date, getdate())
AND CONVERT(time, SUBSTRING(auli.timest, 12, 8 )) > CONVERT(time, DATEADD( hour, -1, getdate()))
AND auli."auliart" NOT LIKE ''
如果我手动启动查询,它工作正常,但服务器代理抛出以下异常:
Wrong Syntax next to 'auliart' [SQLSTATE 42000] (Error 102)