我正在尝试在远程服务器表上插入和更新数据。我不想创建链接服务器连接。以下是我想要的。有人可以建议我如何实现这一目标吗?我正在使用SQL Server 2008。
SELECT *
INTO OPENROWSET ('SQLOLEDB', 'tstapp01';'sa';'*****',
'SELECT * INTO table1 FROM OPENROWSET(''''SQLOLEDB'''',''''172.29.211.12'''';''''sa'''';''''*****'''', ''''Select * from [databasename].dbo.[table2] with (nolock) '''')'''
)
UPDATE OPENROWSET('SQLOLEDB', 'tstapp01';'sa';'*****',
'UPDATE database1.dbo.[table1] SET [column1] = s.[column1], [column2] = s.[column2] FROM database1.dbo.table2 s WITH (nolock) INNER JOIN database1.dbo.[table2] t WITH (nolock) ON s.condition = t.condition OPTION (MAXDOP 1) ')
谢谢