<?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: Understanding and loading SQL Server Temp Tables from Databricks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/understanding-and-loading-sql-server-temp-tables-from-databricks/m-p/101960#M40915</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/47980"&gt;@ranged_coop&lt;/a&gt;&amp;nbsp;, thanks for your question!&lt;BR /&gt;&lt;BR /&gt;Just checking if you were able to make progress, how far you were able to get and if still needing assistance ?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 17:36:06 GMT</pubDate>
    <dc:creator>VZLA</dc:creator>
    <dc:date>2024-12-12T17:36:06Z</dc:date>
    <item>
      <title>Understanding and loading SQL Server Temp Tables from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/understanding-and-loading-sql-server-temp-tables-from-databricks/m-p/89076#M37682</link>
      <description>&lt;P&gt;Hi everyone...&lt;/P&gt;&lt;P&gt;Came across this question in Stackoverflow and wanted to try my hand in trying it. Unfortunately I have not been able to fix it...&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/78953930/create-and-load-sql-server-temp-table-table-or-table-from-databricks?noredirect=1#comment139212403_78953930" target="_blank"&gt;https://stackoverflow.com/questions/78953930/create-and-load-sql-server-temp-table-table-or-table-from-databricks?noredirect=1#comment139212403_78953930&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Some of the observations for your consideration...&lt;/P&gt;&lt;P&gt;1. I was able to create the temp table both (`#table` and `##table`) within a pyodbc code block. It is available within that function but not accessible outside of it.&lt;/P&gt;&lt;P&gt;2. Using `&lt;SPAN&gt;prepareQuery&lt;/SPAN&gt;` I am able to create the temp table in both read and write, but again it is only available within that read/write command i.e. `spark.read.format(jdbc)` and not outside of it.&lt;/P&gt;&lt;P&gt;3. Directly tried writing a dataframe using the `&lt;SPAN&gt;createTableOptions&lt;/SPAN&gt;` and `&lt;SPAN&gt;createTableColumnTypes&lt;/SPAN&gt;` options, but even that is not going anywhere.&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1. How do I create a SQL Server temp table (not databricks) and load it from a spark dataframe and have it accessible across the notebook.&lt;/P&gt;&lt;P&gt;2. What is the scope of a DB Connection in spark. Is it limited to just that one spark.read/spark.write command ? Is it just one connection per command or one connection per executor or core ?&lt;/P&gt;&lt;P&gt;3. Is there any way to ensure that the spark.write does not commit if there is a failure ? I have tried AutoCommit to False, but it is not working. I read somewhere that spark does indeed commit every n rows even in the case of a failure.&lt;/P&gt;&lt;P&gt;Useful Link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html" target="_blank"&gt;https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope brighter minds than mine can help me with the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much...&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2024 15:21:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/understanding-and-loading-sql-server-temp-tables-from-databricks/m-p/89076#M37682</guid>
      <dc:creator>ranged_coop</dc:creator>
      <dc:date>2024-09-08T15:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding and loading SQL Server Temp Tables from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/understanding-and-loading-sql-server-temp-tables-from-databricks/m-p/101960#M40915</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/47980"&gt;@ranged_coop&lt;/a&gt;&amp;nbsp;, thanks for your question!&lt;BR /&gt;&lt;BR /&gt;Just checking if you were able to make progress, how far you were able to get and if still needing assistance ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 17:36:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/understanding-and-loading-sql-server-temp-tables-from-databricks/m-p/101960#M40915</guid>
      <dc:creator>VZLA</dc:creator>
      <dc:date>2024-12-12T17:36:06Z</dc:date>
    </item>
  </channel>
</rss>

