diff --git a/chat2db-server/chat2db-plugins/chat2db-sqlserver/src/main/java/ai/chat2db/plugin/sqlserver/type/SqlServerColumnTypeEnum.java b/chat2db-server/chat2db-plugins/chat2db-sqlserver/src/main/java/ai/chat2db/plugin/sqlserver/type/SqlServerColumnTypeEnum.java index 9117be841..7be1a04ce 100644 --- a/chat2db-server/chat2db-plugins/chat2db-sqlserver/src/main/java/ai/chat2db/plugin/sqlserver/type/SqlServerColumnTypeEnum.java +++ b/chat2db-server/chat2db-plugins/chat2db-sqlserver/src/main/java/ai/chat2db/plugin/sqlserver/type/SqlServerColumnTypeEnum.java @@ -98,11 +98,16 @@ public enum SqlServerColumnTypeEnum implements ColumnBuilder { XML("XML", false, false, true, false, false, false, true, true), + OTHER("OTHER", false, false, true, false, false, false, true, true), ; private ColumnType columnType; public static SqlServerColumnTypeEnum getByType(String dataType) { - return COLUMN_TYPE_MAP.get(dataType.toUpperCase()); + SqlServerColumnTypeEnum typeEnum = COLUMN_TYPE_MAP.get(dataType.toUpperCase()); + if (typeEnum == null) { + return OTHER; + } + return typeEnum; } private static Map COLUMN_TYPE_MAP = Maps.newHashMap(); @@ -255,7 +260,9 @@ private String buildDataType(TableColumn column, SqlServerColumnTypeEnum type) { } return script.toString(); } - + if(OTHER.equals(columnType)){ + return column.getColumnType(); + } return columnType; }