SELECT
'private '
+' '+
CASE WHEN DATA_TYPE='int' THEN 'int'
WHEN DATA_TYPE='decimal' THEN 'double'
WHEN DATA_TYPE='nvarchar' THEN 'String'
ELSE '其他' END
+' '+
COLUMN_NAME+';'
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'unit' -- 替换为你的表名
AND TABLE_SCHEMA = 'dbo'; -- 或者替换为你的schema名