<?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 Write data into synapse dedicated sql pool from fabric notebook in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/4014884#M2734</link>
    <description>&lt;P&gt;How to write data into synapse dedicated sql pool from fabric notebook.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to save the spark dataframe from Fabric Notebook into Azure Synapse dedicated sql pool.&lt;/P&gt;&lt;P&gt;Is it doable, if yes, can anyone please share the code, along with any configuration settings if needed at the dedicated sql pool level.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2024 06:46:57 GMT</pubDate>
    <dc:creator>SriThiru</dc:creator>
    <dc:date>2024-06-28T06:46:57Z</dc:date>
    <item>
      <title>Write data into synapse dedicated sql pool from fabric notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/4014884#M2734</link>
      <description>&lt;P&gt;How to write data into synapse dedicated sql pool from fabric notebook.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to save the spark dataframe from Fabric Notebook into Azure Synapse dedicated sql pool.&lt;/P&gt;&lt;P&gt;Is it doable, if yes, can anyone please share the code, along with any configuration settings if needed at the dedicated sql pool level.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 06:46:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/4014884#M2734</guid>
      <dc:creator>SriThiru</dc:creator>
      <dc:date>2024-06-28T06:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Write data into synapse dedicated sql pool from fabric notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/4764864#M10950</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/333087"&gt;@SriThiru&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I see your question is remained as unanswered for a long time.&lt;/P&gt;&lt;P&gt;Yes, you can definitely write data from a Spark DataFrame in a Fabric Notebook to an Azure Synapse dedicated SQL pool.&lt;/P&gt;&lt;P&gt;You’ll just need to use the .write method with the jdbc format. Here's a simple example to get you started:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;df.write \
  .format("jdbc") \
  .option("url", "jdbc:sqlserver://&amp;lt;your-server-name&amp;gt;.sql.azuresynapse.net:1433;database=&amp;lt;your-database-name&amp;gt;") \
  .option("dbtable", "&amp;lt;your-schema&amp;gt;.&amp;lt;your-table-name&amp;gt;") \
  .option("user", "&amp;lt;your-username&amp;gt;") \
  .option("password", "&amp;lt;your-password&amp;gt;") \
  .option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") \
  .mode("append") \
  .save()&lt;/LI-CODE&gt;&lt;H3&gt;A few quick tips:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Make sure your dedicated SQL pool allows Azure services to connect (you can set this in the firewall settings).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The table you're writing to should already exist in Synapse with the right schema.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If you're using managed identity instead of SQL auth, you’ll need to handle authentication a bit differently (happy to help with that if needed).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/in/mehrdad-abdollahi/" target="_blank" rel="noopener"&gt;Mehrdad Abdollahi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 08:02:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/4764864#M10950</guid>
      <dc:creator>mabdollahi</dc:creator>
      <dc:date>2025-07-16T08:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Write data into synapse dedicated sql pool from fabric notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/5311214#M17342</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/333087"&gt;@SriThiru&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, ye bilkul possible hai. Fabric Notebook se Synapse Dedicated SQL Pool me data likhne ke 2 tareeke hain:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**Option 1: Using spark.write with JDBC**&amp;nbsp;&lt;/P&gt;&lt;P&gt;```python&lt;/P&gt;&lt;P&gt;df.write \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .format("com.microsoft.sqlserver.jdbc.spark") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .mode("overwrite") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .option("url", "jdbc:sqlserver://your-server.sql.azuresynapse.net:1433;database=yourDB") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .option("dbtable", "schema.tableName") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .option("user", "username") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .option("password", "password") \&lt;/P&gt;&lt;P&gt;&amp;nbsp; .save()&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2026 15:39:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/5311214#M17342</guid>
      <dc:creator>Areeshabaloch7</dc:creator>
      <dc:date>2026-07-21T15:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Write data into synapse dedicated sql pool from fabric notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/5311368#M17346</link>
      <description>&lt;P&gt;Yes, it is possible to write data from a &lt;STRONG&gt;Microsoft Fabric Notebook Spark DataFrame&lt;/STRONG&gt; into an &lt;STRONG&gt;Azure Synapse Dedicated SQL Pool&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The recommended approach is to use the &lt;STRONG&gt;Synapse Spark connector for SQL DW&lt;/STRONG&gt;, which allows Spark to write data directly into Synapse Dedicated SQL Pool.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;# Install the connector if required
# (Usually available in Fabric Spark runtime)

df.write \
    .format("com.databricks.spark.sqldw") \
    .option("url", "jdbc:sqlserver://&amp;lt;server-name&amp;gt;.sql.azuresynapse.net:1433;database=&amp;lt;database-name&amp;gt;") \
    .option("dbTable", "&amp;lt;schema&amp;gt;.&amp;lt;table_name&amp;gt;") \
    .option("forwardSparkAzureStorageCredentials", "true") \
    .option("tempDir", "abfss://&amp;lt;container&amp;gt;@&amp;lt;storage-account&amp;gt;.dfs.core.windows.net/&amp;lt;temp-folder&amp;gt;") \
    .mode("overwrite") \
    .save()&lt;/PRE&gt;&lt;P&gt;Before running this, make sure:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The Fabric workspace identity or user identity has permission to access the Synapse SQL Pool.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The required network connectivity is available (firewall, private endpoints, managed identity configuration if applicable).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The staging storage location (tempDir) is accessible because the connector uses Azure Storage as an intermediate step before loading into Dedicated SQL Pool.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The target table permissions are configured correctly (CREATE TABLE, INSERT, etc., depending on the operation).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Another option is to use the standard JDBC approach:&lt;/P&gt;&lt;PRE&gt;df.write \
  .format("jdbc") \
  .option("url", "jdbc:sqlserver://&amp;lt;server-name&amp;gt;.sql.azuresynapse.net:1433;database=&amp;lt;database-name&amp;gt;") \
  .option("dbtable", "&amp;lt;schema&amp;gt;.&amp;lt;table_name&amp;gt;") \
  .option("user", "&amp;lt;username&amp;gt;") \
  .option("password", "&amp;lt;password&amp;gt;") \
  .mode("append") \
  .save()&lt;/PRE&gt;&lt;P&gt;However, for larger datasets, the dedicated SQL Pool connector is generally preferred because it uses parallel loading.&lt;/P&gt;&lt;P&gt;A few best practices:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;For large data volumes, avoid row-by-row inserts through JDBC.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Use bulk loading patterns whenever possible.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Partition your Spark DataFrame appropriately before writing.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Monitor Synapse SQL Pool distribution and table design (hash distribution, round-robin, clustered columnstore indexes) for better performance.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For more information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Azure Synapse Dedicated SQL Pool Spark connector:&lt;/STRONG&gt; &lt;A href="https://learn.microsoft.com/azure/synapse-analytics/spark/synapse-spark-sql-pool-import-export" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/azure/synapse-analytics/spark/synapse-spark-sql-pool-import-export&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Fabric Spark notebooks:&lt;/STRONG&gt; &lt;A href="https://learn.microsoft.com/fabric/data-engineering/how-to-use-notebook" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/fabric/data-engineering/how-to-use-notebook&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; Helpful? Give a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; — keep the community growing.&lt;/STRONG&gt;&lt;/H4&gt;&lt;H4&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; Solved your issue? Mark this as the Accepted Solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;/H4&gt;&lt;H4&gt;&lt;STRONG&gt;Best regards,&lt;/STRONG&gt; &lt;STRONG&gt;Prince Singh | Data Science &amp;amp; Microsoft Fabric Enthusiast&lt;/STRONG&gt;&lt;/H4&gt;</description>
      <pubDate>Tue, 21 Jul 2026 16:39:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Write-data-into-synapse-dedicated-sql-pool-from-fabric-notebook/m-p/5311368#M17346</guid>
      <dc:creator>Prince0011</dc:creator>
      <dc:date>2026-07-21T16:39:45Z</dc:date>
    </item>
  </channel>
</rss>

