<?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 Is it possible to add an index/row number/identity with a Copy activity? in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515254#M983</link>
    <description>&lt;P&gt;Greetings, community. I have a pipeline I'm using to insert data into a data warehouse table.&amp;nbsp;Since Fabric's DW doesn't yet provide an identity column, I want to add a unique identifier to the data. I know I can run a script after the Copy Activity completes that assigns a GUID, but is it possible to do this from within the Copy Activity itself so I don't have to first insert and then update?&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 21:01:05 GMT</pubDate>
    <dc:creator>arpost</dc:creator>
    <dc:date>2023-11-03T21:01:05Z</dc:date>
    <item>
      <title>Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515254#M983</link>
      <description>&lt;P&gt;Greetings, community. I have a pipeline I'm using to insert data into a data warehouse table.&amp;nbsp;Since Fabric's DW doesn't yet provide an identity column, I want to add a unique identifier to the data. I know I can run a script after the Copy Activity completes that assigns a GUID, but is it possible to do this from within the Copy Activity itself so I don't have to first insert and then update?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 21:01:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515254#M983</guid>
      <dc:creator>arpost</dc:creator>
      <dc:date>2023-11-03T21:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515269#M984</link>
      <description>&lt;P&gt;No, unfortunately this is no such way inside Copy. But feel free to submit an idea on Fabric Ideas page.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 21:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515269#M984</guid>
      <dc:creator>ajarora</dc:creator>
      <dc:date>2023-11-03T21:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515469#M991</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415771" data-lia-user-login="ajarora" class="lia-mention lia-mention-user"&gt;ajarora&lt;/a&gt;&amp;nbsp; for your insights.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307993" data-lia-user-login="arpost" class="lia-mention lia-mention-user"&gt;arpost&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Appreciate if you could share the feedback on our &lt;A href="https://ideas.fabric.microsoft.com/" target="_self"&gt;feedback channel&lt;/A&gt;&amp;nbsp;.&amp;nbsp;Which would be open for the user community to upvote &amp;amp; comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. Please let me know if you have any further queries.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 03:27:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3515469#M991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-04T03:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3518268#M1020</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307993" data-lia-user-login="arpost" class="lia-mention lia-mention-user"&gt;arpost&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Otherwise, will respond back with the more details and we will try to help .&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 17:51:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3518268#M1020</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-06T17:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3525294#M1070</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307993" data-lia-user-login="arpost" class="lia-mention lia-mention-user"&gt;arpost&lt;/a&gt;&amp;nbsp;- I had this same issue/requirement.&amp;nbsp; I was able to figure out a way to do this though:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stage and Prod Tables:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I setup a staging table to load the data I wanted to upsert.&amp;nbsp; In the Prod Table I added what would typically have been my Identity column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stored Proc/SQL Query Load:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the SQL Query that would load the data from Stage to Prod; I created a variable called "MaxKey".&amp;nbsp; That would get the current maximum value currently in my identity column.&amp;nbsp; That would be the starting point for any new records I needed to insert.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DECLARE @MaxIdentity bigint;
SET @MaxIdentity = (SELECT MAX(productrowkey) from dimProduct);&lt;/LI-CODE&gt;&lt;P&gt;Then in my query to actual generate the rows to update you can use the ROW_Number() function:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT
  ROW_NUMBER() OVER (ORDER BY stg.ProductName ASC) + @MaxIdentity as productkey,
  stg.ProductName
FROM stage_Product stg
LEFT JOIN dimProduct prd on stg.ProductName = stg.ProductName
WHERE prd.productkey is null
&lt;/LI-CODE&gt;&lt;P&gt;So far everything appears to be working as expected for me.&amp;nbsp; The downside later is that once the Identity function is supported you will have to migrate data to a new table as I don't think you can convert an existing column to an Identity.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 13:53:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3525294#M1070</guid>
      <dc:creator>jwinchell40</dc:creator>
      <dc:date>2023-11-09T13:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add an index/row number/identity with a Copy activity?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3525413#M1072</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="599628" data-lia-user-login="jwinchell40" class="lia-mention lia-mention-user"&gt;jwinchell40&lt;/a&gt;. That's similar to the approach I adopted, and it works.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 14:23:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Is-it-possible-to-add-an-index-row-number-identity-with-a-Copy/m-p/3525413#M1072</guid>
      <dc:creator>arpost</dc:creator>
      <dc:date>2023-11-09T14:23:22Z</dc:date>
    </item>
  </channel>
</rss>

