Change Data Capture: Invalid object name 'sys.fn_cdc_get_max_lsn' and 'sys.fn_cdc_get_min_lsn'
<p>I'm trying to be a good SQL citizen  and <strong>not</strong> use the CDC tables directly, and use the <a href="https://technet.microsoft.com/en-us/library/bb510627(v=sql.105).aspx" rel="nofollow noreferrer">TVFs</a>, it fails miserably for me.(SQL 2012 Enterprise SP3), following the pattern..</p>

<pre><code>DECLARE @from_lsn binary(10), @to_lsn binary(10)
SET @from_lsn =
   sys.fn_cdc_get_min_lsn('mytable')
SET @to_lsn   = sys.fn_cdc_get_max_lsn()
SELECT * FROM cdc.fn_cdc_get_all_changes_mytable
  (@from_lsn, @to_lsn, N'mytable');
GO
</code></pre>

<p>I got the error </p>

<blockquote>
  <p>Invalid object name 'cdc.fn_cdc_get_all_changes_mytable'.</p>
</blockquote>

<p>I then discovered I needed to put the schema infront of the table name on the function, but then got this:</p>

<blockquote>
  <p>An insufficient number of arguments were supplied for the procedure or
  function cdc.fn_cdc_get_all_changes_ ... .</p>
</blockquote>

<p>So I tried to debug the lsn values to see if they were NULL/zero, as other posts encountered this issue but then discovered these functions didn't exist.</p>

<p><a href="https://i.stack.imgur.com/TLu4t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TLu4t.png" alt="enter image description here"></a></p>

<p>As you can see I can find these functions myself in the master db. Anyone know what I've done wrong?</p>

<p>I saw this <a href="https://connect.microsoft.com/SQLServer/feedback/details/765206/missing-cdc-system-function" rel="nofollow noreferrer">Microsoft connect article</a> where someone experienced the same issue, and their resolution is untenable.</p>