简体   繁体   中英

Synapse pyspark - execute stored procedure on Azure SQL Database?

Ok, I'm trying to adapt some Databricks notebooks (pyspark) to Synapse. I need to execute stored procedures/DDL/etc. on a regular Azure SQL DB in several places. In DBX, there's a known, if somewhat clunky, way to accomplish it. In the init script, you install pyodbc and the linux odbc driver for SQL Server. Then in your notebook, you make a pyodbc connection for your "executenonquery" procedures, updates, DDL, etc.

In Synapse, pyodbc is one of the default libraries, but I'm not sure how to ensure the sql server odbc driver is installed/available. I confirmed that neither "ODBC Driver 18 for SQL Server" nor "ODBC Driver 17 for SQL Server" is installed. Is there any way to install the driver here?

Ok, I was screwing up the url. Synapse does include "ODBC Driver 17 for SQL Server" by default. You can use the same methodology as in Databricks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM