0

我想将数据从一台服务器发送到另一台服务器,我想提高我的性能,并想知道 OpenQuery 是否是一个很好的失败途径?

我试图做这样的事情;

INSERT INTO OPENQUERY (SERVERNAME, '(SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
(Num1, Num2, Num3)
SELECT Num1, Num2, Num3
 FROM #Temp

但是,这会返回错误

The provider indicates that conflicts occurred with other properties or requirements.

我不明白这一点,因为查询确实运行良好并在没有 OpenQuery 的情况下产生所需的结果......

请问有人可以给我建议吗?

4

1 回答 1

1

尝试这个:

INSERT INTO tablename 
SELECT * FROM OPENROWSET
    ('SQLOLEDB', 
     'Trusted_Connection=yes;Server=SERVERNAME','SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
于 2012-11-05T11:18:01.930 回答