title: SQL Server Exception: "The column name xxx is not valid" when using JDBC
body: <p>I'm getting a strange error from the SQL Server JDBC driver. It is telling me that a column name is invalid even though the column is present, correctly named and the same query works fine when executed in SqlServer Management Studio.</p>
  
  <p>The error is:</p>
  
  <pre><code>Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The column name MarginCall is not valid.
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
      at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(SQLServerResultSet.java:626)
      at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getBigDecimal(SQLServerResultSet.java:2570)
      at org.apache.commons.dbcp.DelegatingResultSet.getBigDecimal(DelegatingResultSet.java:305)
  ...
  </code></pre>