How to load SQL Server table from SharePoint Excel file with MFA

Hemant 1 Reputation point Microsoft Vendor
2021-10-30T18:30:40.273+00:00

Hi Team,

I am trying to create PowerShell script which source the data from SharePoint Excel file (MFA Authentication) and load it to SQL Server table.

Regards

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,664 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Allen Xu_MSFT 13,776 Reputation points
    2021-11-01T07:22:23.107+00:00

    Hi @Hemant ,

    As per my knowledge, we can only import data from Excel stored on your computer locally or from a SharePoint list to SQL Server. I'm afraid importing excel files directly into SQL Server is not supported. You have to download the Excel file to your local computer or export the Excel file to a SharePoint list, and then load it to the SQL Server table.

    Reference:
    Load data directly in SQL Server from a xlsx file, without OLEDB or Excel, using Powershell
    How To Insert SharePoint List Item To MS SQL Server Using PowerShell

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Limitless Technology 39,351 Reputation points
    2021-11-03T09:24:39.99+00:00

    Hi there,

    You can connect Excel to a database and then import data and create tables and charts based on values in the database. You can set up the connection between Excel and a database table, save the file that stores data and the connection information for Excel, and then create a pivot chart from the database values.

    Connect Excel to a database in Azure SQL Database or Azure SQL Managed Instance, and create a report https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-excel

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    -If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments