SQL Server Database Import script in Excel

Source: Internet
Author: User

With the help of old colleagues, I sent this script in my blog:

Exec sp_configure 'show advanced options', 1
Reconfigure
Exec sp_configure 'ad Hoc Distributed Queries ', 1
Reconfigure

SELECT * INTO tmp_asset
From openrowset ('Microsoft. Jet. OLEDB.4.0 ',
'Excel 8.0; Database = d: \ Excel Data Source \ asset seal .xls ',
'Select * FROM [Sheet1 $] ');

Note:

D: \ Excel Data Source \ asset seal .xls ---------> is the physical path of the file.

FROM [Sheet1 $] ----------> where Sheet1 is the worksheet name.

The rest is to perform some data matching on the columns related to tmp_asset. We will not talk about it here :)

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.