<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can I connect to an Azure SQL db from a Databricks notebook? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18468#M12258</link>
    <description>&lt;P&gt;I know how to do it with spark, and read/write tables (like &lt;A href="https://docs.microsoft.com/en-gb/azure/databricks/data/data-sources/sql-databases#python-example" target="test_blank"&gt;https://docs.microsoft.com/en-gb/azure/databricks/data/data-sources/sql-databases#python-example&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;But this time, I need to only update a field of a specific row in a table. I do not think I can do that with &lt;A href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.jdbc.html" alt="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.jdbc.html" target="_blank"&gt;spark jdbc &lt;/A&gt;(mode for append or overwrite)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I tried to use jaydebeapi and pymssql, but no success.&lt;/P&gt;&lt;P&gt;jaydebeapi  would: Class com.microsoft.sqlserver.jdbc.SQLServerDriver is not found&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also tried to use pyodbc, but failed to install mssql odbc driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the best practice for that usecase?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 15:33:45 GMT</pubDate>
    <dc:creator>yopbibo</dc:creator>
    <dc:date>2022-06-07T15:33:45Z</dc:date>
    <item>
      <title>How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18468#M12258</link>
      <description>&lt;P&gt;I know how to do it with spark, and read/write tables (like &lt;A href="https://docs.microsoft.com/en-gb/azure/databricks/data/data-sources/sql-databases#python-example" target="test_blank"&gt;https://docs.microsoft.com/en-gb/azure/databricks/data/data-sources/sql-databases#python-example&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;But this time, I need to only update a field of a specific row in a table. I do not think I can do that with &lt;A href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.jdbc.html" alt="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.jdbc.html" target="_blank"&gt;spark jdbc &lt;/A&gt;(mode for append or overwrite)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I tried to use jaydebeapi and pymssql, but no success.&lt;/P&gt;&lt;P&gt;jaydebeapi  would: Class com.microsoft.sqlserver.jdbc.SQLServerDriver is not found&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also tried to use pyodbc, but failed to install mssql odbc driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the best practice for that usecase?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 15:33:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18468#M12258</guid>
      <dc:creator>yopbibo</dc:creator>
      <dc:date>2022-06-07T15:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18470#M12260</link>
      <description>&lt;P&gt;thanks for the link.&lt;/P&gt;&lt;P&gt;I am maybe wrong, but they describe how to connect with spark. They do not provide a connection engine that we could use directly (like with pyodbc) or an engine that we could use in pandas, for example.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 15:26:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18470#M12260</guid>
      <dc:creator>yopbibo</dc:creator>
      <dc:date>2022-06-09T15:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18472#M12262</link>
      <description>&lt;P&gt;thanks!&lt;/P&gt;&lt;P&gt;but here again, it goes through the spark interface.&lt;/P&gt;&lt;P&gt;Therefore, comes with spark limits. For example, when write, we can "overwrite" or "append".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if we want to, only, update an existing row?&lt;/P&gt;&lt;P&gt;Could load all the table, update it in spark, and write it back. But if the table is large, and we need to do that in a very short time?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 14:36:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18472#M12262</guid>
      <dc:creator>yopbibo</dc:creator>
      <dc:date>2022-06-10T14:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18474#M12264</link>
      <description>&lt;P&gt;sure!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;pip install jaydebeapi pymssql
&amp;nbsp;
import jaydebeapi
import pymssql
&amp;nbsp;
pymssql.connect(server='xxxxxxxxxxxxxxxxx.database.windows.net',
                       user='sqladmin@xxxxxxxxxxxxxxxxx',
                       password='1234',
                       database="yyyyyyyyyyyyyyyyy",
                       port='1433',
                      )
&amp;nbsp;
pymssql.connect(server='xxxxxxxxxxxxxxxxx.database.windows.net',
                       user='sqladmin',
                       password='1234',
                       database="yyyyyyyyyyyyyyyyy",
                       port='1433',
                      )
&amp;nbsp;
jaydebeapi.connect('com.microsoft.sqlserver.jdbc.SQLServerDriver',
                   'jdbc:sqlserver://xxxxxxxxxxxxxxxxx.database.windows.net:1433;database=yyyyyyyyyyyyyyyyy',
                   ['sqladmin', '1234'])&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;bellow, outputs:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OperationalError: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (xxxxxxxxxxx.database.windows.net)\nNet-Lib error during Connection refused (111)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (xxxxxxxxxxxxx.database.windows.net)\nNet-Lib error during Connection refused (111)\n')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;same for the second call.&lt;/P&gt;&lt;P&gt;and last, for jaydebeapi&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TypeError: Class com.microsoft.sqlserver.jdbc.SQLServerDriver is not found&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 15:28:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/18474#M12264</guid>
      <dc:creator>yopbibo</dc:creator>
      <dc:date>2022-06-22T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/84051#M37117</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/39536"&gt;@yopbibo&lt;/a&gt;&amp;nbsp; - Did you find the answer that you were looking for? i.e. update individual rows in db tables?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 11:05:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/84051#M37117</guid>
      <dc:creator>Abhiram_B</dc:creator>
      <dc:date>2024-08-23T11:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to an Azure SQL db from a Databricks notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/116061#M45236</link>
      <description>&lt;P&gt;Look at your compute configuration. Looks like this works perfectly on Dedicated (formerly: single user) or No isolation clusters, but not on Standard (formerly: Shared) ones.&lt;/P&gt;&lt;P&gt;Maybe you need a disposable one-time job cluster with these settings.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 12:15:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-can-i-connect-to-an-azure-sql-db-from-a-databricks-notebook/m-p/116061#M45236</guid>
      <dc:creator>raopheefah</dc:creator>
      <dc:date>2025-04-21T12:15:57Z</dc:date>
    </item>
  </channel>
</rss>

