title: How to Return Nested Promise
body: <p>I am trying to return the <code>result</code> parameter from the <code>getColumn</code> function.  When logging, it returns undefined.  </p>
  
  <p>The connection function connects to a SQL DB and the query returns a data set.</p>
  
  <p>How can I pass the variable back up the promise chain?</p>
  
  <pre><code>getColumn = function(columnName, table) {
    sql.connect(config.properties)
      .then(result =&gt; {
        let request = new sql.Request();
        request.query("SELECT " + columnName + " FROM " + table)
        .then(result =&gt; {
            // want to return this result from the getColumn function
            return result
        }).catch(err =&gt; {
            // Query error checks
        })
      }).catch(err =&gt; {
        // Connection error checks
      })
  } // 
  
  console.log(getColumn('username', 'Login'))
  </code></pre>