<?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 Global INIT script on sql warehouse in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/global-init-script-on-sql-warehouse/m-p/122386#M46759</link>
    <description>&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;Is it possible to configure global INIT script on sql warehouse? If not, how can I achieve my below requirement-&lt;/P&gt;&lt;P&gt;For example, this script will have 2 key and value pairs defined : src_catalog_name=ABC, tgt_catalog_name=DEF&lt;/P&gt;&lt;P&gt;I want these 2 be reflected on all sql warehouses when they start. I learnt about SQL warehouse configuration parameters and see there is a pre-defined list and that is not applicable therefor for me.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-parameters" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-parameters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;appreciate the thoughts.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jun 2025 17:21:40 GMT</pubDate>
    <dc:creator>noorbasha534</dc:creator>
    <dc:date>2025-06-20T17:21:40Z</dc:date>
    <item>
      <title>Global INIT script on sql warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/global-init-script-on-sql-warehouse/m-p/122386#M46759</link>
      <description>&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;Is it possible to configure global INIT script on sql warehouse? If not, how can I achieve my below requirement-&lt;/P&gt;&lt;P&gt;For example, this script will have 2 key and value pairs defined : src_catalog_name=ABC, tgt_catalog_name=DEF&lt;/P&gt;&lt;P&gt;I want these 2 be reflected on all sql warehouses when they start. I learnt about SQL warehouse configuration parameters and see there is a pre-defined list and that is not applicable therefor for me.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-parameters" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-parameters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;appreciate the thoughts.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2025 17:21:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/global-init-script-on-sql-warehouse/m-p/122386#M46759</guid>
      <dc:creator>noorbasha534</dc:creator>
      <dc:date>2025-06-20T17:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Global INIT script on sql warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/global-init-script-on-sql-warehouse/m-p/122433#M46771</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124839"&gt;@noorbasha534&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, in &lt;STRONG&gt;SQL Warehouses&lt;/STRONG&gt;, you can't attach an &lt;STRONG&gt;init script&lt;/STRONG&gt; that automatically runs when the warehouse starts (similar to what you can do with clusters).&lt;/P&gt;&lt;P&gt;However, there are a few alternatives you can consider:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Session Variables&lt;/STRONG&gt;: You can set session variables like src_catalog_name and tgt_catalog_name within the current session. These variables will persist only for the duration of the session and need to be redefined when the session restarts. You can use these variables in your queries during the session. &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-variables" target="_self"&gt;Docs&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Widgets&lt;/STRONG&gt;: Another option is to use &lt;STRONG&gt;widgets&lt;/STRONG&gt; to parameterize your queries. Widgets allow you to create interactive elements in notebooks, which can help you define values dynamically. These are especially useful for dashboards and notebooks where user input is required. &lt;A href="https://docs.databricks.com/aws/en/notebooks/widgets#use-widget-values-in-spark-sql-and-sql-warehouse" target="_self"&gt;Docs&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;SQL Procedures (Public Preview)&lt;/STRONG&gt;: If your account has access to the &lt;STRONG&gt;SQL Procedures&lt;/STRONG&gt; feature (currently in public preview), you can define procedural logic with variables and dynamic SQL. This feature might offer a more flexible solution, but you'll need to verify if it's available in your account. &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-scripting" target="_self"&gt;Docs&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;So you'll need to manage these variables and parameters manually for each session or query run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2025 14:32:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/global-init-script-on-sql-warehouse/m-p/122433#M46771</guid>
      <dc:creator>Isi</dc:creator>
      <dc:date>2025-06-21T14:32:16Z</dc:date>
    </item>
  </channel>
</rss>

