@staticmethod
def derive_field_length(column):
    """
        Returns the width of a field based based on the data type of column.

        :param dict column: Info about the column.

        :rtype: int
        """
    data_type = column['data_type']
    if data_type == 'bigint':
        return column['precision']
    if data_type == 'int':
        return column['precision']
    if data_type == 'smallint':
        return column['precision']
    if data_type == 'tinyint':
        return column['precision']
    if data_type == 'bit':
        return column['max_length']
    if data_type == 'money':
        return column['precision']
    if data_type == 'smallmoney':
        return column['precision']
    if data_type == 'decimal':
        return column['precision']
    if data_type == 'numeric':
        return column['precision']
    if data_type == 'float':
        return column['precision']
    if data_type == 'real':
        return column['precision']
    if data_type == 'date':
        return column['precision']
    if data_type == 'datetime':
        return column['precision']
    if data_type == 'datetime2':
        return column['precision']
    if data_type == 'datetimeoffset':
        return column['precision']
    if data_type == 'smalldatetime':
        return column['precision']
    if data_type == 'time':
        return column['precision']
    if data_type == 'char':
        return column['max_length']
    if data_type == 'varchar':
        if column['max_length'] == -1:
            return 2147483647
        return column['max_length']
    if data_type == 'text':
        return 2147483647
    if data_type == 'nchar':
        return column['max_length'] / 2
    if data_type == 'nvarchar':
        if column['max_length'] == -1:
            return 1073741823
        return column['max_length'] / 2
    if data_type == 'ntext':
        return 1073741823
    if data_type == 'binary':
        return column['max_length']
    if data_type == 'varbinary':
        return column['max_length']
    if data_type == 'image':
        return 2147483647
    if data_type == 'xml':
        return 2147483647
    if data_type == 'geography':
        if column['max_length'] == -1:
            return 2147483647
    if data_type == 'geometry':
        if column['max_length'] == -1:
            return 2147483647
    raise Exception("Unexpected data type '{0}'".format(data_type))
