Excel DB的存储过程 [英] Stored Procedure for Excel DB

查看:73
本文介绍了Excel DB的存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何仅使用存储过程选择/插入/更新/删除Excel数据到Sql DB.

谁能帮助我做到这一点

Hi

How to select/insert/update/Delete Excel Data into Sql DB by using Stored Procedure only.

can anyone help me to do this

推荐答案

如果启用了临时分布式查询",则可以使用以下内容:
You can use the following if "Adhoc Distributed Queries" are enabled:
sp_configure 'show advanced options',1
go
reconfigure
go
sp_configure 'Ad Hoc Distributed Queries',1
go
reconfigure
go


SELECT Statement
----------------------
select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\blog_samples\excel_file_2003.xls;','SELECT * FROM [Sheet1


') UPDATE 语句 - --------------------- 更新 OPENROWSET (' Microsoft.Jet.OLEDB.4.0'' Excel 8.0; Database = C :\ blog_samples \ excel_file_2003.xls;'' SELECT * FROM [Sheet1
') UPDATE Statement ----------------------- update OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\blog_samples\excel_file_2003.xls;','SELECT * FROM [Sheet1


') set description = ' 新描述-产品3'跨度> 其中 code = ' 30' INSERT 语句 - -------------------- 插入 插入 OPENROWSET (' Microsoft.Jet.OLEDB.4.0'' Excel 8.0; Database = C:\ blog_samples \ excel_file_2003.xls;''
') set description='New Description - Product 3' where code='30' INSERT Statement ---------------------- insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\blog_samples\excel_file_2003.xls;','SELECT * FROM [Sheet1


这篇关于Excel DB的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆