title: How to put select statement returned into a variable
body: <p>I have this stored procedure,</p>
  
  <pre><code>Create procedure [dbo].[Craping_GetFruitCrapedOrNot]
  (
      @FruitID int,
      @CrateID int,
      @FruitName varchar(100)
  )
  AS
    SELECT CASE WHEN EXISTS
    (
       SELECT     Craping.CRAPED
       FROM         Fruits 
            INNER JOIN Craping 
            ON Fruits.ID = Craping.FruitID
       WHERE     
           (Fruits.FruitTable = @FruitName) 
           AND (Craping.FruitID = @FruitID) 
           AND (Craping.CrateID = @CrateID)
    ) 
    THEN 'False'
    ELSE 'True'
    END AS FruitNotCraped
  GO  
  </code></pre>
  
  <p>Now    if exists then instead of returning false  <code>THEN 'False'</code> I want to return whatever returned from select statement, not sure how though?</p>
  
  <pre><code>Then return SELECT     Craping.CRAPED
           FROM         Fruits 
                INNER JOIN Craping 
                ON Fruits.ID = Craping.FruitID
           WHERE     
               (Fruits.FruitTable = @FruitName) 
               AND (Craping.FruitID = @FruitID) 
               AND (Craping.CrateID = @CrateID)
  </code></pre>