EXCEL导入SQL

EXCEL导入SQL 
<script type="text/javascript">function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
<script src="http://wz.youkuaiyun.com/javascripts/vote.js" type="text/javascript"></script> style="MARGIN-TOP: 0px; FLOAT: left" border="0" marginwidth="0" framespacing="0" marginheight="0" src="http://wz.youkuaiyun.com/vote.aspx?t=EXCEL%u5BFC%u5165SQL%20-%20inshine%u7684%u4E13%u680F%20-%20优快云Blog&u=http%3A//blog.youkuaiyun.com/inshine/archive/2005/10/27/517825.aspx" frameborder="0" noresize="noresize" width="54" scrolling="no" height="75">  EXCEL导入SQL   <script src="http://blog.youkuaiyun.com/count.aspx?ID=517825&Type=Rank" type="text/javascript"></script>    优快云 Blog推出文章指数概念,文章指数是对Blog文章综合评分后推算出的,综合评分项分别是该文章的点击量,回复次数,被网摘收录数量,文章长度和文章类型;满分100,每月更新一次。

insert into 表1(列1,列2...) select * from | select 列1,列2 into 表 from
openrowset('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;database=c:/aaaa.xls;HDR=Yes;IMEX=1', sheet1$)

 

imex=1是表示把混合数据类型强制转换为文本行

 


--导入已经存在的表中
insert into 表
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 5.0;HDR=YES;DATABASE=c:/test.xls',sheet1$)

--导入并生成表
select * into 表 from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 5.0;HDR=YES;DATABASE=c:/test.xls',sheet1$)



Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=517825

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值