title: Getting the error 'System.Data.SqlClient.SqlException: Remote table-valued function calls are not allowed.'
body: <p>While trying to call a stored procedure which is on a linked server, I get this error:  </p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: Remote table-valued function calls are not allowed.</p>
  </blockquote>
  
  <p>I tried using the <code>openquery</code>, but it is not sufficing my situation as I need to run test case automation scripts which contains many lines of code. When I am trying to use </p>
  
  <pre><code>EXEC LinkedServer.Database.dbo.sp_executesql 
  </code></pre>
  
  <p>I am getting another error saying </p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword 'Database'</p>
  </blockquote>