title: Fetching Data from one table and inserting into another using stored procedure in SQL 2012
body: <p>I want to fetch data from one table and insert into another using stored procedure.
  Below is my code:  </p>
  
  <pre><code>CREATE PROCEDURE uspInitiateSRFWorkFlow 
          @WFPolicyID nvarchar(50) = null 
      AS
      BEGIN
          SET NOCOUNT ON;    
          INSERT INTO ProjectWorkflowAgg
          SELECT * FROM WFPolicyDetails where MasterCode = @WFPolicyID ORDER BY Priority ASC;
      END
      GO
  </code></pre>
  
  <p>Error is :
  Msg 2809, Level 18, State 1, Line 1
  The request for procedure 'WFPolicyDetails' failed because 'WFPolicyDetails' is a table object.</p>