--這些語句是不能夠一起執行的哦,在2008上測試沒有問題,但是在2000上不知道會怎麼樣呢?
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
insert into ERP_DB
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="d:/11.xls";User ID=;Password=;Extended properties=Excel 5.0')...[data_input$]
where SC_ZDRQ is not null
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure