分布式查询 opendatasource()

本文介绍了如何使用OpenDataSource在SQL Server中进行异类查询,包括从Access和Excel导入数据到SQL Server,从SQL Server导出数据到Access和Excel,以及在SQL Server中直接查询Excel数据的方法。
摘要由CSDN通过智能技术生成
insert into t_gene_sy_pres (pres_name,address,byrs,edus_id,gdrxnl,kinderclass_id,kindertype_id)
SELECT pres_name,address,cast(byrs as numeric),cast(edus_id as numeric),cast(gdrxnl as numeric),
cast(kinderclass_id as numeric),cast(kindertype_id as numeric) FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0',
'Data Source="F:/TEST/TEST.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[T_GENE_SY_PRES]
 

update opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="F:/各幼儿园师生资料/已处理/zhiye.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$] set 职位='其他' where 职位 not in ('园长','教师','保健员','保育员','营养员',保教主任','财务','报帐员','书记','园长助理')
 
insert into opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="F:/资源.xls";User ID=Admin;Password=;Extended Properties=Excel 5.0')...[Sheet1$]
select p.pres_name,c.cla_name,f.res_title,f.res_path,f.pub_time from opendatasource('SQLOLEDB','Data Source=;User ID=sa;Password=').[pd-baby].dbo.t_gene_re_file f
join opendatasource('SQLOLEDB','Data Source=;User ID=sa;Password=').[pd-baby].dbo.t_gene_re_class c on
f.cla_id = c.cla_id join opendata
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值