一、开启批量 导入
--启用Ad Hoc Distributed Queries:exec sp_configure 'show advanced options',1reconfigureexec sp_configure 'Ad Hoc Distributed Queries',1reconfigure--使用完成后,关闭Ad Hoc Distributed Queries:exec sp_configure 'Ad Hoc Distributed Queries',0reconfigureexec sp_configure 'show advanced options',0reconfigure
?
?
二、OFFICE2003版本用MICROSOFT.JET.OLEDB.4.0
OFFICE2007及以后版本用Microsoft.ACE.OLEDB.12.0
如:
set @[email protected] --更新已存在的学生成绩 set @sql='update [email protected]+' set [email protected]+' from [email protected]+' a inner join ( SELECT 学生ID,[email protected]+' FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 8.0;IMEX=1;HDR=YES;[email protected]+''',[getidefen$]) ) b on a.学生ID=b.学生ID where [email protected]+''' and [email protected] exec(@sql)
?
?
三、
?
?