日期:2014-05-17 浏览次数:20558 次
create proc daoru
(@filepath varchar(100), --> 文件路径
@filename varchar(100) --> 文件名
)
as
begin
declare @tsql varchar(6000)
select @tsql='insert into tb_yuanbiao select * from '
+' openrowset(''microsoft.jet.oledb.4.0'',''excel 5.0;hdr=yes;database='+@filepath+'\'+@filename+';'', '
+' ''select * from [sheet1$]'') '
exec(@tsql)
end