Excel Data Import Data Sheet

Source: Internet
Author: User

Environment:

Windows Server (RM)

SQL Server 2012

Excel Data Import Data Sheet

INSERT  into [dbo].[AdminUser]                SELECT [Adminuserid]           ,[Namezh]           ,IsNull([Nameeng],"') as [Nameeng]           ,[Password]           ,[Createdatetime]           ,[Updatedatetime]           ,[Recordtimestamp]  from OPENROWSET('microsoft.ace.oledb.12.0', 'Excel 12.0;database=c:\website\macaustore\data\alldata_20151216.xls; Hdr=yes;imex=1','select * FROM [adminuser$]')
View Code

Error Resolution: http://stackoverflow.com/questions/13888082/ Ole-db-provider-microsoft-ace-oledb-12-0-for-linked-server-null-returned-m

    • Download and install the new component from microsoft:http://www.microsoft.com/downloads/en/details.aspx? familyid=c06b8369-60dd-4b64-a44b-84b371ede16d&displaylang=en
      • This would install the access and other engines you need to set up linked servers, OPENROWSET Excel files, etc.
  • Open up SQL Server and run the following:

    sp_configure'Show advanced Options',1;GORECONFIGURE;GOsp_configure'Ad Hoc Distributed Queries',1;GORECONFIGURE;GOEXECMaster.dbo.sp_MSset_oledb_prop N'microsoft.ace.oledb.12.0'N'allowinprocess',1GOEXECMaster.dbo.sp_MSset_oledb_prop N'microsoft.ace.oledb.12.0'N'dynamicparameters',1GO
    View Code

  • Now, if you is running OPENROWSET calls you need to abandon calls, made using the old JET parameters and use the new call S as follows:
    (*Example, importing an EXCELfileDirectly intoSQL):D ont do ....SELECT *  from OPENROWSET('microsoft.jet.oledb.4.0','Excel 8.0; Hdr=yes;database=c:\path_to_your_excel_file.xls','select * FROM [sheet1$]') UseThis INSTEAD ...SELECT *  from OPENROWSET('microsoft.ace.oledb.12.0','Excel 12.0;database=c:\path_to_your_excel_file.xls','select * FROM [sheet1$]')*At this point resolved-SQL issues andRan perfectly
    View Code

Excel Data Import Data Sheet

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.