title: exec sp_execute followed by a number
body: <p>When using Microsoft SQL Profiler and you see <code>exec sp_execute</code> followed by a number and some arguments (e.g.)</p>
  <pre class="lang-sql prettyprint-override"><code>exec sp_execute 38,@maxChangeTrackingNumberPublishedApplication=7400,@maxChangeTrackingNumberInstalledApplication=7400
  </code></pre>
  <p>What does the number after <code>sp_execute</code> indicate (38 in this case)? How do I determine what SQL that is executing?</p>
  <p>The <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-execute-transact-sql?view=sql-server-ver16" rel="nofollow noreferrer">documentation</a> says:</p>
  <blockquote>
  <p><em>handle</em>
  Is the handle value returned by sp_prepare. handle is a required parameter that calls for int input value.</p>
  </blockquote>
  <p>I can see no sign of sp_prepare in my Profiler Trace?</p>
  <p>Is there an SQL command to list out all the prepared SQL that sp_execute may be running?</p>