您的位置:首页 > 其它

Update 和 Select 结合使用,导入外部服务器的数据

2011-11-28 09:42 232 查看
/* -- 首先启用 Ad Hoc Distributed Queries :--

exec sp_configure 'show advanced options',1

reconfigure

exec sp_configure 'Ad Hoc Distributed Queries',1

reconfigure

GO

*/

Update a

Set a.Uid = b.Uid, a.IsRent=b.isRent

From louRoom as a, openDataSource('SqlOledb', 'server=192.168.1.0; uid=sa; pwd=123456;').cyyDB.dbo.louRoomas
b

Where
a
.id = b.id

/* -- 使用完成后,关闭Ad Hoc Distributed Queries:--

exec sp_configure 'Ad Hoc Distributed Queries',0

reconfigure

exec sp_configure 'show advanced options',0

reconfigure

GO

*/

---- 读取Excel格式文件的方法----

Select *

From OpenDataSource

(

'Microsoft.Jet.OLEDB.4.0',

'Excel 8.0; IMEX=1; Database=E:\test.xls'

)...[标签1$]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐