excel数据导入到 sql server 2000 的sql 语句操作
-- truncate table KQ_YRLeaveYear
insert into KQ_YRLeaveYear(PersonnelId,Nian,LeaveDays,SpareDays,PerDays,StartDate,EndDate,DelayTimes ,DelayDays)
select b.personnelID,aa as Nian,isnull(ee,0) as LeaveDays ,isnull(cc,0) as SpareDays,isnull(ff,0) as PerDays, bb,bb,0 as DelayTimes,0 as DelayDays
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\aaa.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...sheet1$ a
join Pub_YRPersonnel b on (a.bb=b.workno)
order by b.personnelID,cc
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=587044
浙公网安备 33010602011771号