I want to update a table tbl on serer svr1 and database db1
update tmp
set tmp.col = case when tmp.col1 = 1 then tmp.col1 + 1
else tmp.col1 + 2
end
from OPENROWSET('SQLOLEDB','svr1';'uid';'pwd','select * from db1.dbo.tbl') tmp
but it is erroring
the error is
Msg 208, Level 16, State 1, Line 1
Invalid object name 'tmp'.
a linkedserver is all setup
what would be the reason
Thanks
update tmp
set tmp.col = case when tmp.col1 = 1 then tmp.col1 + 1
else tmp.col1 + 2
end
from OPENROWSET('SQLOLEDB','svr1';'uid';'pwd','select * from db1.dbo.tbl') tmp
but it is erroring
the error is
Msg 208, Level 16, State 1, Line 1
Invalid object name 'tmp'.
a linkedserver is all setup
what would be the reason
Thanks