Sql Serverリモート接続データベース(Oracleのdblink方式に相当)


方法は比較的に簡単で、直接接続して、データを提出します(主に2台のホストがイントラネットの中にあるため、ネットの伝送のIOの問題を考慮しなくてもいいです).
SELECT * FROM OPENROWSET('SQLOLEDB','       /IP';'   ';'  ',  .dbo.  )

注意:
1.中間の3つのパラメータの間にセミコロン(;)分割;
2.最後のパラメータは引用符で囲む必要はありません.
データ量が多すぎる場合は、ファイル形式でデータベースにロードすることをお勧めします.
また、クエリが間違っている場合:
   15281,   16,   1,  2  
SQL Server        'Ad Hoc Distributed Queries'   STATEMENT 'OpenRowset/OpenDatasource'    ,                        。            sp_configure    'Ad Hoc Distributed Queries'。     'Ad Hoc Distributed Queries'      ,    SQL Server        "       "。

「Ad Hoc Distributed Queries」コンポーネントが開いていないことを示します.次の文で開きます.
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
RECONFIGURE

対応するクローズ文:
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure