title: Retrieve data from SP inside of From
body: <p>I would like to use [sp_Test] to retrieve the data from the syntax code "FROM" but it does not work. Do you know how to solve it?</p>
  
  <p>Thanks!</p>
  
  <p><img src="https://i.stack.imgur.com/DPUzO.png" alt="enter image description here"></p>
  
  <pre><code>create table datatable (id int,
                          name varchar(100),
                          email varchar(10),
                          phone varchar(10),
                          cellphone varchar(10),
                          none varchar(10)                        
                         );
  
  insert into datatable values
    (1, 'productname', 'A', 'A', 'A', 'A'), 
    (2, 'cost', '20', 'A', 'A', 'A'),
    (3, 'active', 'Y', 'A', 'A', 'A');
  
  insert into datatable values
    (4, 'productname', 'A', 'A', 'A', 'A'), 
    (5, 'cost', '20', 'A', 'A', 'A'),
    (6, 'active', 'Y', 'A', 'A', 'A');
  
  
  insert into datatable values
    (7, 'productname', 'A', 'A', 'A', 'A'), 
    (8, 'cost', '20', 'A', 'A', 'A'),
    (9, 'active', 'Y', 'A', 'A', 'A');
  
  
  CREATE PROCEDURE [sp_Test]
  as
  begin
      set nocount on
  
      SELECT a.name, a.email, a.phone
      FROM datatable a 
  
  end
  </code></pre>