title: Use Dynamic Query in a Procedure and call that procedure in a select statement in SQL Server
body: <p>I need to execute a dynamic query in SQL Server and show the result in a select query. </p>
  
  <p>Since, we cannot use dynamic queries in functions, we have written a stored procedure to return the dynamic query value. </p>
  
  <p>But how can i call my stored procedure in a select query. </p>