Use DataBaseName/*开启Ad Hoc Distributed Queries组件exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure*/Insert into tableName (col1,col2,col3,……) --字段不能含有主键SELECT col1,col2,col3,……from opendatasource
('SQLOLEDB','Data Source=192.168.0.1;User ID=dbuser;Password=123456'
).DataBaseName.dbo.tableName
WHERE [datetime]>'2016-11-01 15:00:18.663'
AND [datetime]<'2016-11-01 15:00:18.663'/*关闭Ad Hoc Distributed Queries组件exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
*/