title: Suggested way for ADF to trigger pipeline by SQL table change
body: <p>I have a tracking SQL table which has following schema:</p>
  <pre><code>CREATE TABLE [dbo].[TEST_TABLE](
      [id] [int] IDENTITY(1,1) NOT NULL,
      [value] [nvarchar](50) NULL,
      [status] [nvarchar](50) NULL,
      [source] [nvarchar](50) NULL,
      [timestamp] [datetime] NULL
  )
  </code></pre>
  <p>My application code will automatically maintain the table by inserting record and updating the field <code>status</code>.</p>
  <p>My target is to trigger an ADF pipeline based on the result of following query:</p>
  <pre><code>SELECT COUNT(1) AS cnt FROM [dbo].[TEST_TABLE] WHERE [status] = 'active'
  </code></pre>
  <p>If the result is &gt;0, then trigger an ADF pipeline.</p>
  <p><strong>Current status:</strong></p>
  <p>My current work:</p>
  <ol>
  <li>set up an Stored procedure SP_TEST to return 1 if condition is filled; otherwise 0</li>
  <li>setup an pipeline like below:
  <a href="https://i.stack.imgur.com/J2Zg4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J2Zg4.png" alt="enter image description here" /></a></li>
  </ol>
  <p>the result of SP is parsed and used for routing to trigger later stages (which will mark the SQL table status to 'inactive' to avoid duplicate processing)
  3. associate the pipeline with a scheduling trigger every 5 minutes.</p>
  <p>My current work is &quot;working&quot;, in the sense that it can <strong>detect for whether there is DB change</strong> every 5 minutes and execute subsequent processing.</p>
  <p><strong>Problem:</strong></p>
  <p>However, the scheuling trigger may be too frequent and cost activity run unit on every execution, which could be costly. Is there any trigger like &quot;SQL table change trigger&quot;?</p>
  <p><strong>what I have tried:</strong></p>
  <ul>
  <li><p>A quick google points me to this <a href="https://docs.microsoft.com/en-us/answers/questions/197465/how-to-trigger-an-adf-based-on-any-data-changes-wi.html" rel="nofollow noreferrer">link</a>, but seems no answer yet.</p>
  </li>
  <li><p>I am also aware of storage event trigger and custom events trigger. Unfortunately, we are not permitted to create other Azure resource. Only the existing ADF and SQL server is provided to us.</p>
  </li>
  </ul>
  <p>Appreciate any insights/directions in advance.</p>