如何使用带有连接语句的SQL OPENQUERY删除
这是我的代码..这有什么问题?
delete from
OPENQUERY(LINKSERVERNAME, 'SELECT Z.* from Project1.dbo.table1 Z') A
left join Project2.dbo.Table2 B on A.ID = B.ID
where B.ID is null
Project1数据库位于在线sql Server中 Project2数据库在我的本地sql Server
中感谢
答案 0 :(得分:1)
试试这个..
DELETE FROM A
FROM OPENQUERY([LINKSERVERNAME], 'SELECT Z.* from Project1.dbo.table1 Z') A
LEFT JOIN Project2.dbo.Table2 B ON A.ID = B.ID
WHERE B.ID is null