title: How do I assign multiple inline variables in T-SQL?
body: <p>I am trying to select multiple variables from a subquery in order to use later.  Here's my code:</p>
  
  <pre><code>DECLARE @MarketplaceName VARCHAR(50),
      @ProductFieldID INT,
      @FromValue VARCHAR(255) = (
          SELECT mcvm.MarketplaceName,
              mcvm.ProductFieldID,
              mcvm.FromValue
          FROM [Meta].[MarketplaceCategoryValueMapping] AS mcvm
          WHERE mcvm.MarketplaceCategoryValueMappingID = @MapID
          )
  </code></pre>
  
  <p>I'm getting the following error message:</p>
  
  <blockquote>
    <p><em>Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.</em></p>
  </blockquote>
  
  <p>I'm trying to map <code>@MarketplaceName</code> from <code>mcvm.MarketplaceName</code>, etc.</p>
  
  <p>What I would like is to not have to write multiple <code>SELECT</code> statements for each of these variables.</p>