Micrsosoft Office 365: How to Connect SQL To SharePoint lists?
When you use SharePoint Online and Microsoft 365 you can keep your data close to you with your own SharePoint on-premises installation. You can use both systems and connect them.
Integrating specifically external SQL data sources (e.g. from SQL Server, Oracle, DB2, Informix, MySQL) with SharePoint lists (e.g. news, contacts, tasks or custom lists) in Microsoft Office 365, SharePoint Online or SharePoint on-premises can close many gaps. It's not only about displaying external SQL data - it's about full integration with views, search, lookups, forms, change notifications, and workflows.
With Layer2 Cloud Connector you can connect on-premise and cloud-based data sources to your SharePoint lists and libraries in minutes. No programming, no network adjustments, no need to change the connected systems or your data. ODBC, OLEDB, OData, Microsoft.NET based providers, file content (Excel, XML, CSV), file shares, SQL databases like SQL Server, Oracle, MySQL, IBM DB2, IBM AS/400, IBM Informix, Notes, systems like SharePoint, Exchange, Active Directory, Navision, SAP, PowerShell and more sources are supported. If you haven't tested our tool yet, you can start your free trial now.
Step by step instruction to connect SQL to SharePoint lists
This detailed instruction gives a step-by-step example with Microsoft SQL Server. Learn how to connext SQL to SharePoint lists. It works in the same way for any other database.
Step 2 - setup your SQL to SharePoint connection
With Layer2 Cloud Connector Connection Manager (a MMC snap-in) you have to setup the connection (e.g. uni-directional or bi-directional, scheduling etc.), data source (your SQL database) and data destination (in SharePoint on-premise, SharePoint Online or Office 365. The list must be created manually before).
You can use auto mapping to connect the fields of both data entities by name or map fields manually. Please note:
- Bi-directional connections require appropriate access rights on database. Use uni-directional connections if you want to push SQL data only to the cloud.
- Please enable scheduling later, when all settings are verified and you have an idea of replication duration. Duration time depends on bandwidth, performance of source and destination, and number of fields and records in SQL. Only changes are transferred later on.
Before running the connection, you have to define the data source and destination. Please note:
- Select the SQL Provider that fits to your database. If it's not in list, it must be installed. Take care about 64-Bit and 32-Bit. The Cloud Connector can run in both modes, but it can connect only to those providers, that fits.
- Enter a valid connection string for your database system. See www.connectionstrings.com to know.
- The provider offers the possibility to enter direct queries, depending on database system. Select as few fields as required to increase performance.
- For most systems you can use aliases in field names to fit to your SharePoint Online list, e.g. Select Productname as Title from products.
- Use the data preview to check out the result of your query.
- For most systems a "primary key" is set automatically.
- Please verify all settings before save.
Next you have to define your data destination. Please note:
- Use the Layer2 SharePoint CSOM Provider to connect to SharePoint on-premise, SharePoint Online or Office 365.
- You have to create the destination list manually with all columns required to host your query data.
- Please note that you can connect to any other type of data destination, e.g. to other SQL databases.
- There is no need to enter a primary key, the provider automatically uses the SharePoint item ID.
Now you have to setup the column / field mapping. You can use the auto-mapping feature (by field / column names) or map manually. Please note:
- The mapping of ProductName to Title, as SharePoint required a Title field.
- In this case we have included the SourceID to have a clear reference to the original record.
That is not a requirement, but advised as best practice.
- Please note the difference in data types. The Layer2 Cloud Connector tries to match as close as possible.
If all settings are verified, please go to connection root and run the connection manually first. Please note, that it could take some time to transfer all nodes. You can take a look in your cloud list to see how it goes on.