protected function processColumn($tableInfo, $col)
{
$columnId = $col['COLUMN_NAME'];
$info['ColumnName'] = "[{$columnId}]";
//quote the column names!
$info['ColumnId'] = $columnId;
$info['ColumnIndex'] = intval($col['ORDINAL_POSITION']) - 1;
//zero-based index
if ($col['IS_NULLABLE'] !== 'NO') {
$info['AllowNull'] = true;
}
if ($col['COLUMN_DEFAULT'] !== null) {
$info['DefaultValue'] = $col['COLUMN_DEFAULT'];
}
if (in_array($columnId, $tableInfo->getPrimaryKeys())) {
$info['IsPrimaryKey'] = true;
}
if ($this->isForeignKeyColumn($columnId, $tableInfo)) {
$info['IsForeignKey'] = true;
}
if ($col['IsIdentity'] === '1') {
$info['AutoIncrement'] = true;
}
$info['DbType'] = $col['DATA_TYPE'];
if ($col['CHARACTER_MAXIMUM_LENGTH'] !== null) {
$info['ColumnSize'] = intval($col['CHARACTER_MAXIMUM_LENGTH']);
}
if ($col['NUMERIC_PRECISION'] !== null) {
$info['NumericPrecision'] = intval($col['NUMERIC_PRECISION']);
}
if ($col['NUMERIC_SCALE'] !== null) {
$info['NumericScale'] = intval($col['NUMERIC_SCALE']);
}
$tableInfo->Columns[$columnId] = new TMssqlTableColumn($info);
}