http://www.brentozar.com/archive/2009/09/whats-on-my-bookshelf/
/* Prepare dummy query */ rc = SQLPrepare (... "SELECT * FROM UnknownTable WHERE 1 = 0" ...); /* Query is never executed on the server - only prepared */ rc = SQLNumResultCols (...); for (irow = 1; irow <= NumColumns; irow++) { rc = SQLDescribeCol (...) /* + optional calls to SQLColAttributes */ } /* Result column information has now been obtained. Note we also know the column ordering within the table! This information cannot be assumed from the SQLColumns example. */













