Import execl tabular data into a database you can specify columns or *
Note: The statement can only be executed on the local database if the connection is made to the server on which the remote server should execute the statement
Set the server global configuration enable AD Hoc distributed Queries
This component is a security risk, so the default is to turn off
exec‘show advanced options‘,1reconfigureexec‘Ad Hoc Distributed Queries‘,1reconfigure
You can import the specified column in the EXECL table to the specified column in the specified table
insert into 表名(字段名) select 字段名(跟上面对应)from OpenDataSource(‘Microsoft.Ace.OLEDB.12.0‘,‘Data Source="c:\文档名.xls";Extended properties="Excel 12.0;HDR=Yes"‘)...[文档表名$]
Set the server global configuration to turn off ad Hoc distributed Queries
exec‘Ad Hoc Distributed Queries‘,0reconfigureexec‘show advanced options‘,0reconfigure
EXECL data import into SQL Server