title: how to set return type of a stored procedure according to a specific table
body: <p>I had made a dynamic stored procedure like this </p>
  
  <pre><code>CREATE PROCEDURE [dbo].[MyProcedure]
      @pSelect nvarchar(max)
  AS
  BEGIN
      SET NOCOUNT ON;
  
      DECLARE @SQL nvarchar(max)
  
      SET @SQL = 'select ' + @pSelect + ' from tabel1';
  
      EXEC (@SQL)
  END
  </code></pre>
  
  <p>And on updating my entitydatamodel the in context.cs  the above stored procedure is in the form of</p>
  
  <pre><code> virtual int MyProcedure(string pSelect)
              {
                  var pSelectParameter = pSelect != null ?
                      new ObjectParameter("pSelect", pSelect) :
                      new ObjectParameter("pSelect", typeof(string));
  
                  return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("MyProcedure", pSelectParameter);
              }
  </code></pre>
  
  <p>on calling the stored procedure from c# code</p>
  
  <pre><code>var result = myDataModel.MyProcedure("Select * From table1").tolist();
  </code></pre>
  
  <p>the above code is showing error because MyProcedure is returning a  integer return type<br/>
  so how could i set the return type of the stored procedure according to tje select query I am passing to it<br/></p>
  
  <p>HOW DO I MODIFY MY STORED PROCEDURE SO THAT ITS RETURN TYPE IS OF ANY SPECIFIC TABLE TYPE</p>