【发布时间】:2011-10-01 19:47:30
【问题描述】:
我想使用以下代码更新远程表,但遇到此错误:
`Msg 208, Level 16, State 1, Line 12
Invalid object name 'f1'.`
代码:
declare @temp table
(
co_kargah bigint,
code_ostan nvarchar(10)
)
insert into @temp
select co_kargah,code_ostan
from Tbl_ghireHadese_Temp
where InsUpKey=2
update f1 /* Error location*/
set
f1.modate_mogharar=tbl_ghireHadese.modate_mogharar,
f1.t_pm_mogharar=tbl_ghireHadese.t_pm_mogharar
from openquery([lnkworkersystem],'select * from Bazresi_Kar.dbo.Tbl_ghireHadese') f1
inner join @temp temp
on temp.co_kargah=f1.co_kargah
and temp.code_ostan=f1.code_ostan
and temp.t_bazresiFE=f1.t_bazresiFE
inner join tbl_ghireHadese
on temp.co_kargah=tbl_ghireHadese.co_kargah
and temp.code_ostan=tbl_ghireHadese.code_ostan
and temp.t_bazresiFE=tbl_ghireHadese.t_bazresiFE
【问题讨论】:
标签: sql-server-2000 linked-server