<?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 Re: Query data from Fabric SQL DB using spark / python. in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125922#M15314</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/803370"&gt;@chetanhiwale&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If the JDBC and synapsesql approaches didn't work, you can try using pyodbc directly in a Fabric notebook:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tamanchu_0-1772699630910.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328881iC6A1776EE71FB84A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tamanchu_0-1772699630910.png" alt="Tamanchu_0-1772699630910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, could you share the error messages you got with the JDBC and synapsesql methods? That would help narrow down the root cause.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2026 08:34:24 GMT</pubDate>
    <dc:creator>Tamanchu</dc:creator>
    <dc:date>2026-03-05T08:34:24Z</dc:date>
    <item>
      <title>Query data from Fabric SQL DB using spark / python.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125300#M15303</link>
      <description>&lt;P&gt;Hi Folks,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to query data using Fabric SQL DB using python / pyspark. But I am not getting proper syntax to query. If anyone has , can someone share the syntax.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks and regards.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 08:36:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125300#M15303</guid>
      <dc:creator>chetanhiwale</dc:creator>
      <dc:date>2026-03-04T08:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query data from Fabric SQL DB using spark / python.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125311#M15304</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/803370"&gt;@chetanhiwale&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can query a Fabric SQL Database from a Spark notebook using JDBC. Here's a working example:&lt;/P&gt;&lt;P&gt;jdbc_url = "jdbc:sqlserver://&amp;lt;your-server&amp;gt;.database.fabric.microsoft.com:1433;database=&amp;lt;your-db&amp;gt;"&lt;/P&gt;&lt;P&gt;df = spark.read \&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .format("jdbc") \&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .option("url", jdbc_url) \&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .option("dbtable", "dbo.YourTable") \&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .option("authentication", "ActiveDirectoryInteractive") \&lt;BR /&gt;&amp;nbsp; &amp;nbsp; .load()&lt;BR /&gt;df.show()&lt;BR /&gt;Alternatively, if your SQL DB is in the same workspace, you can use the synapsesql connector:&lt;BR /&gt;df = spark.read.synapsesql("YourDatabase.dbo.YourTable")&lt;/P&gt;&lt;P&gt;Did this help?&lt;BR /&gt;Drop a kudo so others can find it !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 09:01:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125311#M15304</guid>
      <dc:creator>Tamanchu</dc:creator>
      <dc:date>2026-03-04T09:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Query data from Fabric SQL DB using spark / python.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125911#M15312</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1357760"&gt;@Tamanchu&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;I tried both both options but they are not working for me. Have you tried to use MS-SQL python module by Microsoft&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 08:13:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125911#M15312</guid>
      <dc:creator>chetanhiwale</dc:creator>
      <dc:date>2026-03-05T08:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Query data from Fabric SQL DB using spark / python.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125922#M15314</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/803370"&gt;@chetanhiwale&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If the JDBC and synapsesql approaches didn't work, you can try using pyodbc directly in a Fabric notebook:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tamanchu_0-1772699630910.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1328881iC6A1776EE71FB84A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tamanchu_0-1772699630910.png" alt="Tamanchu_0-1772699630910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, could you share the error messages you got with the JDBC and synapsesql methods? That would help narrow down the root cause.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 08:34:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Query-data-from-Fabric-SQL-DB-using-spark-python/m-p/5125922#M15314</guid>
      <dc:creator>Tamanchu</dc:creator>
      <dc:date>2026-03-05T08:34:24Z</dc:date>
    </item>
  </channel>
</rss>

