<?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 Scala how to write data to sqlmi table that has identity col, auto-initialized col DATETIME DEFAULT in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/scala-how-to-write-data-to-sqlmi-table-that-has-identity-col/m-p/72278#M34540</link>
    <description>&lt;P&gt;Scala, I am trying to write dataframe to sqlmi table, it works for all other table when dataframe columns matches table columns, and I created a new table with the identity and auto-initialized column, from what I understand, by default, I don't need to add value for these two column, and thus my dataframe doesn't include the two columns, but I got an error of:&lt;/P&gt;&lt;PRE&gt;Spark Dataframe and SQL Server table have differing numbers of columns&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How to write data correctly to this type of table?&lt;BR /&gt;df.write&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .format("jdbc"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .mode(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;append&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .option(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, ...&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .option(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;dbtable&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .save();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 11 Jun 2024 00:36:13 GMT</pubDate>
    <dc:creator>JamesY</dc:creator>
    <dc:date>2024-06-11T00:36:13Z</dc:date>
    <item>
      <title>Scala how to write data to sqlmi table that has identity col, auto-initialized col DATETIME DEFAULT</title>
      <link>https://community.databricks.com/t5/data-engineering/scala-how-to-write-data-to-sqlmi-table-that-has-identity-col/m-p/72278#M34540</link>
      <description>&lt;P&gt;Scala, I am trying to write dataframe to sqlmi table, it works for all other table when dataframe columns matches table columns, and I created a new table with the identity and auto-initialized column, from what I understand, by default, I don't need to add value for these two column, and thus my dataframe doesn't include the two columns, but I got an error of:&lt;/P&gt;&lt;PRE&gt;Spark Dataframe and SQL Server table have differing numbers of columns&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How to write data correctly to this type of table?&lt;BR /&gt;df.write&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .format("jdbc"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .mode(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;append&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .option(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, ...&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .option(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;dbtable&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .save();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Jun 2024 00:36:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/scala-how-to-write-data-to-sqlmi-table-that-has-identity-col/m-p/72278#M34540</guid>
      <dc:creator>JamesY</dc:creator>
      <dc:date>2024-06-11T00:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scala how to write data to sqlmi table that has identity col, auto-initialized col DATETIME DEFA</title>
      <link>https://community.databricks.com/t5/data-engineering/scala-how-to-write-data-to-sqlmi-table-that-has-identity-col/m-p/72284#M34543</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/106426"&gt;@JamesY&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Try adding the missing columns as a dummy columns. I've seen this issue happening some time ago - it looks like it's still not fixed.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 04:56:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/scala-how-to-write-data-to-sqlmi-table-that-has-identity-col/m-p/72284#M34543</guid>
      <dc:creator>daniel_sahal</dc:creator>
      <dc:date>2024-06-11T04:56:22Z</dc:date>
    </item>
  </channel>
</rss>

