<?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 Error in Script Activity with Script parameters in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4992961#M14927</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use parameters in a script activity. However I get an error trying to do that.&lt;/P&gt;&lt;P&gt;But according to the docuentation, this approach is supposed to work fine (&lt;A href="https://learn.microsoft.com/en-us/azure/postgresql/configure-maintain/how-to-data-factory-script-activity-fabric?tabs=query" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/azure/postgresql/configure-maintain/how-to-data-factory-script-activity-fabric?tabs=query&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Do you have an idea of the issue in my example ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nejib_0-1770069529584.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324233i448E322A9C920FB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nejib_0-1770069529584.png" alt="Nejib_0-1770069529584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nejib_1-1770069666987.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324234i6B33997011DAFEEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nejib_1-1770069666987.png" alt="Nejib_1-1770069666987.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2026 22:10:33 GMT</pubDate>
    <dc:creator>Nejib</dc:creator>
    <dc:date>2026-02-02T22:10:33Z</dc:date>
    <item>
      <title>Error in Script Activity with Script parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4992961#M14927</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use parameters in a script activity. However I get an error trying to do that.&lt;/P&gt;&lt;P&gt;But according to the docuentation, this approach is supposed to work fine (&lt;A href="https://learn.microsoft.com/en-us/azure/postgresql/configure-maintain/how-to-data-factory-script-activity-fabric?tabs=query" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/azure/postgresql/configure-maintain/how-to-data-factory-script-activity-fabric?tabs=query&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Do you have an idea of the issue in my example ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nejib_0-1770069529584.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324233i448E322A9C920FB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nejib_0-1770069529584.png" alt="Nejib_0-1770069529584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nejib_1-1770069666987.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324234i6B33997011DAFEEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nejib_1-1770069666987.png" alt="Nejib_1-1770069666987.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 22:10:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4992961#M14927</guid>
      <dc:creator>Nejib</dc:creator>
      <dc:date>2026-02-02T22:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Script Activity with Script parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993409#M14937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1241283"&gt;@Nejib&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to the Microsoft fabric community forum.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;In Script activities, parameters can be used only for passing values to a query. They cannot be used for SQL object names such as schema or table names. Because of this, using parameters directly in DDL statements like creating or dropping tables results in a syntax error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please go through the below solved issue, which explains how to construct the SQL statement dynamically using the expression builder, so that the schema and table names are resolved before the script runs.&lt;/P&gt;
&lt;P&gt;&lt;A title="https://community.fabric.microsoft.com/t5/Data-Engineering/Use-Script-parameters-in-Script-activitie-in-Data-Pipeline/m-p/3752740" href="https://community.fabric.microsoft.com/t5/Data-Engineering/Use-Script-parameters-in-Script-activitie-in-Data-Pipeline/m-p/3752740" target="_blank" rel="noreferrer noopener"&gt;Solved: Use Script parameters in Script activitie in Data ... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 09:36:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993409#M14937</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2026-02-03T09:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Script Activity with Script parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993687#M14941</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1241283"&gt;@Nejib&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use dynamic expressions instead, open the expression builder and build out your query in there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The post that&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/882994"&gt;@v-menakakota&lt;/a&gt;&amp;nbsp;linked has an example of this as the accepted solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tayloramy_0-1770129487126.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324401i62F779F77B46536E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tayloramy_0-1770129487126.png" alt="tayloramy_0-1770129487126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 14:38:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993687#M14941</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2026-02-03T14:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Script Activity with Script parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993871#M14943</link>
      <description>&lt;P&gt;Hi Nejib,&lt;BR /&gt;You’re running into this because Script activity parameters can replace only values in a SQL/PGSQL statement, not identifiers (like schema, table, or column names). In other words:&lt;/P&gt;&lt;P&gt;Works: using a parameter in predicates or values (e.g., WHERE status = @status).&lt;BR /&gt;Fails: trying to use a parameter where SQL expects an identifier (e.g., SELECT &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52506"&gt;@col&lt;/a&gt; FROM ... or FROM &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1393324"&gt;@schema&lt;/a&gt;.@table). In those cases, the engine won’t substitute an identifier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your screenshots show &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/69498"&gt;@param&lt;/a&gt; inside the SELECT list or the FROM clause, that’s why it errors.&lt;BR /&gt;Option1:&lt;BR /&gt;If you want to use parameters in sql statement like select,drop,etc&lt;BR /&gt;use pipeline parameters&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 2:&lt;/P&gt;&lt;P&gt;If you want to use script parameters, you need to create SP&lt;BR /&gt;example:&lt;BR /&gt;create stored procedure&lt;/P&gt;&lt;P&gt;CREATE OR ALTER PROCEDURE dbo.usp_select_from_any&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1393324"&gt;@schema&lt;/a&gt;_name sysname, @table_name sysname&lt;BR /&gt;AS&lt;BR /&gt;BEGIN&lt;BR /&gt;&amp;nbsp; DECLARE &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1087193"&gt;@sql&lt;/a&gt; nvarchar(max) =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; N'SELECT * FROM ' + QUOTENAME(@schema_name) + N'.' + QUOTENAME(@table_name) + ';';&lt;BR /&gt;&amp;nbsp; EXEC (@sql);&lt;BR /&gt;END;&lt;/P&gt;&lt;P&gt;call it in script like:&lt;/P&gt;&lt;P&gt;EXEC dbo.usp_select_from_any&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1393324"&gt;@schema&lt;/a&gt;_name = &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1393324"&gt;@schema&lt;/a&gt;_name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @table_name&amp;nbsp; = @table_name;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shreya_Barhate_1-1770137377421.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1324428i63F348239986D9AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Shreya_Barhate_1-1770137377421.png" alt="Shreya_Barhate_1-1770137377421.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Shreya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 16:49:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-in-Script-Activity-with-Script-parameters/m-p/4993871#M14943</guid>
      <dc:creator>Shreya_Barhate</dc:creator>
      <dc:date>2026-02-03T16:49:51Z</dc:date>
    </item>
  </channel>
</rss>

