- //第一步:
- //启用Ad Hoc Distributed Queries:
- exec sp_configure 'show advanced options',1
- reconfigure
- exec sp_configure 'Ad Hoc Distributed Queries',1
- reconfigure
- go
- //第二步:
- SELECT * into dbo.tabel5
- FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
- 'Data Source="D:/book.xls";Extended properties=Excel 5.0')...[Sheet1$]
- go
- //第三步:
- //使用完成后,关闭Ad Hoc Distributed Queries:
- exec sp_configure 'Ad Hoc Distributed Queries',0
- reconfigure
- exec sp_configure 'show advanced options',0
- reconfigure
- go
SQl 语句是Excel中的数据导入到SQL Service数据库中
最新推荐文章于 2021-06-14 22:32:32 发布