Updating the google spreedsheet from MS SQL using Google Scripts
<p>I'm trying to connect the MS SQL to a google spreadsheet using google app scripts. here is my app script code</p>

<pre><code>function SQLdb() {
 // Replace the variables in this block with real values.

// Read up to 1000 rows of data from the table and log them.
function readFromTable() {
  var user = '{usename}';
  var userPwd = '{password}';
  var database = '{databasename}'
  var connectionString = 'jdbc:sqlserver://server.database.windows.net:1433;databaseName='+database;
  var conn = Jdbc.getConnection(connectionString , user, userPwd);

  var start = new Date();
  var stmt = conn.createStatement();
  stmt.setMaxRows(1000);
  var results = stmt.executeQuery('SELECT TOP 1000 * FROM dbo.dbo');
  var numCols = results.getMetaData().getColumnCount();

  while (results.next()) {
    var rowString = '';
    for (var col = 0; col &lt; numCols; col++) {
      rowString += results.getString(col + 1) + '\t';
    }
    Logger.log(rowString)
  }

  results.close();
  stmt.close();

  var end = new Date();
  Logger.log('Time elapsed: %sms', end - start);
 }
 readFromTable();
}
</code></pre>

<p>Now when I look the log in Script Editor, I can see that this connection to the SQL database is working and the script is able to read all the table cell. But I couldn't able to get that data into the spreedsheet. I'm new to app scripts. So is there something that I'm missing here ?</p>

<p>Any help would be much appricated!</p>