title: Calling stored procedure in query
body: <p>I want to call my sp in my query but there is 2 errors:</p>
  
  <pre><code>Msg 156, Level 15, State 1, Line 17
  Incorrect syntax near the keyword 'EXEC'.
  
  Msg 156, Level 15, State 1, Line 19
  Incorrect syntax near the keyword 'AS'.
  </code></pre>
  
  <p>Here is my query:</p>
  
  <pre><code>    SELECT O.OrderId
    ,O.Number
    ,O.Creation
    ,(SELECT Name + ' ' + Surname FROM [User] WHERE UserId = (SELECT CreatedBy FROM [User] WHERE UserId = O.UserId) ) AS OrderOwner
    ,(SELECT Name + ' ' + Surname FROM [User] WHERE UserId = O.UserId )AS Customer
    ,(SELECT Telephone1 FROM [User]  WHERE UserId =  O.UserId) AS Telephone
    ,(SELECT CASE IsActive WHEN 1 THEN 'Indirimli' WHEN 0 THEN 'Indirimsiz' END AS Indirim FROM [User] WHERE UserId = O.UserId) AS Discount
    ,(SELECT CASE IsActive
       WHEN 0
       THEN 
  
           (SELECT SUM(Price) FROM Product WHERE ProductId IN( SELECT ProductId FROM OrderProduct WHERE OrderId = O.OrderId )) 
      WHEN 1
      THEN
      EXEC USP_CalculatePrice 70
  
      END AS Price
     FROM [User] WHERE UserId = O.UserID) AS Price
  
    ,O.Description
    ,O.Status 
    FROM
    [Order] AS O
    WHERE O.Status = 0
  </code></pre>
  
  <p>Do you have any suggestion?</p>