MSSQLSERVER导入EXCEl

来源:互联网 发布:电气工程师难考吗 知乎 编辑:程序博客网 时间:2024/06/16 03:17

Insert into test(id,name) Select idd,names FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="D:\test.xls"; User ID=;Password=;Extended properties=Excel 5.0')...[Sheet1$]

 

1)启用安全策略

exec sp_configure 'show advanced options',1 

reconfigure 

exec sp_configure 'Ad Hoc Distributed Queries',1 

reconfigure

 

2)关闭安全策略

exec sp_configure 'Ad Hoc Distributed Queries',0 

reconfigure 

exec sp_configure 'show advanced options',0 

reconfigure

0 0
原创粉丝点击