<?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 Schema Mismatch on Mirror database from SQL Server in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4862639#M13173</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m having trouble with a mirrored database from SQL Server 2017. The initial synchronization works fine, but when the source data updates, I get a &lt;STRONG&gt;schema mismatch&lt;/STRONG&gt; error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After checking the schema, I found that a column defined as &lt;STRONG&gt;NOT NULL&lt;/STRONG&gt; in the source table appears as I&lt;STRONG&gt;s_Nullable = Yes&lt;/STRONG&gt; in Fabric. I don’t want to modify the source table schema. I’ve already tried restarting replication and CDC, but the issue persists. The error is as follows.&lt;BR /&gt;&lt;BR /&gt;ErrorCode: SchemaMergeFailure, Message: Failed to write table 'dbo\xxxxxxx' due to schema mismatch. Schema merge failure due to potential invalid input. Cause: Type mismatch for column 'Date'. Incoming type: 'date' (Nullable: True), existing type: 'date' (Nullable: False).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else experienced this or found a workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Oct 2025 15:35:01 GMT</pubDate>
    <dc:creator>TWorku</dc:creator>
    <dc:date>2025-10-30T15:35:01Z</dc:date>
    <item>
      <title>Schema Mismatch on Mirror database from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4862639#M13173</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m having trouble with a mirrored database from SQL Server 2017. The initial synchronization works fine, but when the source data updates, I get a &lt;STRONG&gt;schema mismatch&lt;/STRONG&gt; error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After checking the schema, I found that a column defined as &lt;STRONG&gt;NOT NULL&lt;/STRONG&gt; in the source table appears as I&lt;STRONG&gt;s_Nullable = Yes&lt;/STRONG&gt; in Fabric. I don’t want to modify the source table schema. I’ve already tried restarting replication and CDC, but the issue persists. The error is as follows.&lt;BR /&gt;&lt;BR /&gt;ErrorCode: SchemaMergeFailure, Message: Failed to write table 'dbo\xxxxxxx' due to schema mismatch. Schema merge failure due to potential invalid input. Cause: Type mismatch for column 'Date'. Incoming type: 'date' (Nullable: True), existing type: 'date' (Nullable: False).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone else experienced this or found a workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 15:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4862639#M13173</guid>
      <dc:creator>TWorku</dc:creator>
      <dc:date>2025-10-30T15:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Schema Mismatch on Mirror database from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4862900#M13175</link>
      <description>&lt;P&gt;The "not null" is not your issue.&amp;nbsp; Your issue is that Fabric doesn't support auto increment primary keys.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 23:31:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4862900#M13175</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-10-30T23:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Schema Mismatch on Mirror database from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4864896#M13209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/299153"&gt;@TWorku&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for the prompt response.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;The schema mismatch occurs because the nullable flag differs between SQL Server (NOT NULL) and Fabric (Nullable = True). Even though the data type (date) matches, Fabric treats this as a schema conflict. The mirroring process often marks all columns as nullable by default.Since you don’t want to modify the source, fix it on the Fabric side by altering the target column to allow NULLs:&lt;/P&gt;
&lt;P&gt;ALTER TABLE dbo.xxxxxxx ALTER COLUMN [Date] date NULL;&lt;/P&gt;
&lt;P&gt;Then restart the mirroring/CDC job - the incoming and target schemas will align, and the SchemaMergeFailure error will be resolved.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 10:53:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4864896#M13209</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-11-03T10:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Schema Mismatch on Mirror database from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4865249#M13220</link>
      <description>&lt;P class=""&gt;&lt;SPAN&gt;The&amp;nbsp;Alter&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;command cannot be used on a mirrored database due to its read-only state.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;Thank you to &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp; and &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1250613"&gt;@v-venuppu&lt;/a&gt;&amp;nbsp; for trying to help. The issue has been resolved by:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;SPAN&gt;Disabling and re-enabling CDC on the source database.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;SPAN&gt;Re-enabling CDC on all tables one by one.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;SPAN&gt;Creating a new connection with the latest gateway.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;SPAN&gt;Establishing a new database mirror.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class=""&gt;&lt;SPAN&gt;The solution has been stable and monitored successfully for the last four days&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 16:03:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4865249#M13220</guid>
      <dc:creator>TWorku</dc:creator>
      <dc:date>2025-11-03T16:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Schema Mismatch on Mirror database from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4865852#M13235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/299153"&gt;@TWorku&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Great to hear that it's working from your end!I would suggest accepting your approach as the solution so that&amp;nbsp; It would be really helpful for others in the community who might be facing similar issues and can address them quickly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 09:49:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Schema-Mismatch-on-Mirror-database-from-SQL-Server/m-p/4865852#M13235</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-11-04T09:49:38Z</dc:date>
    </item>
  </channel>
</rss>

