EXECL data import into SQL Server

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.