<?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 Fabric Database Stored Procedure Activity Error: &amp;quot;An item with the same key has already been added.&amp;quot; in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4317605#M6563</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am attempting to run a stored procedure in a Fabric Data Factory Pipeline.&amp;nbsp; The stored procedure is hosted on a Fabric Database.&lt;/P&gt;&lt;P&gt;Here are the settings:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The connection test successfully runs.&amp;nbsp; When I run the stored procedure via SSMS it runs successfully also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run within Data Factory, I get this error: "An item with the same key has already been added."&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could cause this?&amp;nbsp; There are no key violations in the table the data is inserting into, and there are no duplicate columns.&lt;/P&gt;&lt;P&gt;I even created a fresh table and pointed the stored procedure to it, and ran with a new stored procedure activity, and I received the same error.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 21:31:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-06T21:31:17Z</dc:date>
    <item>
      <title>Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4317605#M6563</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am attempting to run a stored procedure in a Fabric Data Factory Pipeline.&amp;nbsp; The stored procedure is hosted on a Fabric Database.&lt;/P&gt;&lt;P&gt;Here are the settings:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The connection test successfully runs.&amp;nbsp; When I run the stored procedure via SSMS it runs successfully also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run within Data Factory, I get this error: "An item with the same key has already been added."&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could cause this?&amp;nbsp; There are no key violations in the table the data is inserting into, and there are no duplicate columns.&lt;/P&gt;&lt;P&gt;I even created a fresh table and pointed the stored procedure to it, and ran with a new stored procedure activity, and I received the same error.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 21:31:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4317605#M6563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-06T21:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4319037#M6572</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an error like “&lt;STRONG&gt;An item with the same key has already been added&lt;/STRONG&gt;”. This usually happens when you try to add a duplicate key (such as a or a) to a collection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, other scenarios are normal, but the error occurs in data factory, which may be caused by the auto-detection feature of data factory. In some cases, the auto-detect feature may cause this error. You can try to disable these features as follows:&lt;/P&gt;
&lt;P&gt;1.Open Fabric Data Factory.&lt;BR /&gt;2.Go to Settings Options.&lt;BR /&gt;3.Turn off the “Import relationships from data source on first load” option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 05:55:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4319037#M6572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-09T05:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4319933#M6576</link>
      <description>&lt;P&gt;Where would this setting be in Fabric Data Factory?&amp;nbsp; I cannot find it within the Fabric workspace portal when I open the Data Factory splash page or the pipeline I've already created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'm confused regarding this solution.&amp;nbsp; I'm not loading any data from this activity.&amp;nbsp; It is running a stored procedure.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 15:27:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4319933#M6576</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-09T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4320878#M6582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error("&lt;SPAN&gt;An item with the same key has already been added.")&lt;/SPAN&gt; indicates that stored procedure is trying to add a record with same key which exists already. Are you using Fabric SQL DB ? Is your table is having Identity columns ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srisakthi&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 05:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4320878#M6582</guid>
      <dc:creator>Srisakthi</dc:creator>
      <dc:date>2024-12-10T05:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326482#M6608</link>
      <description>&lt;P&gt;I'm experiencing a similar issue as the OP but when using a Script activity on a Fabric SQL DB. The script is very simple and is not peforming any inserts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TRUNCATE TABLE dbo.TableName&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Dec 2024 17:39:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326482#M6608</guid>
      <dc:creator>arpost</dc:creator>
      <dc:date>2024-12-12T17:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326518#M6609</link>
      <description>&lt;P&gt;I do have identity set up on the table (and yes it is in Fabric Database).&amp;nbsp; If I plug in the parameters passed in a SQL query directly the procedure runs without issue.&amp;nbsp; This leads me to believe this error message is a misnomer provided by Fabric somehow.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 18:30:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326518#M6609</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326520#M6610</link>
      <description>&lt;P&gt;As stated in the original post, I attempted this same operation on a new, empty table and experienced the same behavior - again pointing to some issue in Fabric with these activities.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 18:21:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4326520#M6610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T18:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Fabric Database Stored Procedure Activity Error: "An item with the same key has already been added."</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4347156#M6762</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Here are some quick steps you can try to resolve it:&lt;BR /&gt;1.Check Parameter Names: &amp;nbsp;Ensure all pipeline and stored procedure parameters have unique names.&lt;BR /&gt;2.Verify Mapping: &amp;nbsp;Ensure no duplicate keys in pipeline parameter mapping.&lt;BR /&gt;3.Connection Settings: &amp;nbsp;Double-check connection settings match SSMS.&lt;BR /&gt;4.Stored Procedure Logic: &amp;nbsp;Ensure no duplicate keys are being inserted in the procedure.&lt;BR /&gt;5.Recreate Activity: &amp;nbsp;Recreate the pipeline activity to rule out configuration bugs.&lt;BR /&gt;6.Debug Logs: &amp;nbsp;Use debug logs to identify detailed issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 10:00:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Fabric-Database-Stored-Procedure-Activity-Error-quot-An-item/m-p/4347156#M6762</guid>
      <dc:creator>Ray_Minds</dc:creator>
      <dc:date>2024-12-31T10:00:53Z</dc:date>
    </item>
  </channel>
</rss>

