<?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 SQL Stored Procedure in Databricks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/sql-stored-procedure-in-databricks/m-p/133371#M49818</link>
    <description>&lt;P&gt;Hello, Is there a sql server equivalent stored procedure in Databricks which supports while loop along with delay as below. or are there any other alternative to achieve the same.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;while (select count(*) from schema.mart_daily with (nolock)) = 0
begin
    waitfor delay '00:01'
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thank You in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Sep 2025 12:00:37 GMT</pubDate>
    <dc:creator>ashishasr</dc:creator>
    <dc:date>2025-09-30T12:00:37Z</dc:date>
    <item>
      <title>SQL Stored Procedure in Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-stored-procedure-in-databricks/m-p/133371#M49818</link>
      <description>&lt;P&gt;Hello, Is there a sql server equivalent stored procedure in Databricks which supports while loop along with delay as below. or are there any other alternative to achieve the same.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;while (select count(*) from schema.mart_daily with (nolock)) = 0
begin
    waitfor delay '00:01'
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thank You in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 12:00:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-stored-procedure-in-databricks/m-p/133371#M49818</guid>
      <dc:creator>ashishasr</dc:creator>
      <dc:date>2025-09-30T12:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Stored Procedure in Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-stored-procedure-in-databricks/m-p/133376#M49821</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/152904"&gt;@ashishasr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, support for stored procedures is in public preview:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-procedure" target="_blank"&gt;CREATE PROCEDURE | Databricks on AWS&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the definition of stored procedure you can use compound statement ( SQL compound statement (BEGIN ... END) with the definition of the SQL Procedure.)&lt;/P&gt;&lt;P&gt;And inside compound statement you can use while statement:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/control-flow/while-stmt" target="_blank"&gt;WHILE statement | Databricks on AWS&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_0-1759235856151.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/20315iCECD7A9B375B3A6A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_0-1759235856151.png" alt="szymon_dybczak_0-1759235856151.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 12:37:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-stored-procedure-in-databricks/m-p/133376#M49821</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-09-30T12:37:42Z</dc:date>
    </item>
  </channel>
</rss>

