SELECT
Name,
Case system_type_id
WHEN 127 THEN 'long'
WHEN 56 THEN 'int'
WHEN 60 THEN 'decimal'
WHEN 106 THEN 'decimal'
WHEN 61 THEN 'DateTime'
WHEN 104 THEN 'bool'
WHEN 165 THEN 'byte[]'
WHEN 108 THEN 'double'
WHEN 231 THEN 'string'
WHEN 99 THEN 'string'
WHEN 239 THEN 'string'
WHEN 167 THEN 'string'
when 62 then 'decimal'
ELSE 'ukn:'+CAST(system_type_id AS NVARCHAR(10))
END As [Type],
system_type_id,
'[DataField("' + name + '")] ' +
+ 'public '+ Case system_type_id
WHEN 127 THEN 'long'
WHEN 56 THEN 'int'
WHEN 60 THEN 'decimal'
WHEN 106 THEN 'decimal'
WHEN 61 THEN 'DateTime'
WHEN 104 THEN 'bool'
WHEN 165 THEN 'byte[]'
WHEN 108 THEN 'double'
WHEN 231 THEN 'string'
WHEN 99 THEN 'string'
WHEN 239 THEN 'string'
WHEN 167 THEN 'string'
when 62 then 'decimal'
ELSE 'ukn:'+CAST(system_type_id AS NVARCHAR(10))
END + ' '+ replace(replace(replace(name, ' ','_'), '-','_'), '''','_') + ' { get; set; }'
AS Code,
'public '+ Case system_type_id
WHEN 127 THEN 'long'
WHEN 56 THEN 'int'
WHEN 60 THEN 'decimal'
WHEN 106 THEN 'decimal'
WHEN 61 THEN 'DateTime'
WHEN 104 THEN 'bool'
WHEN 165 THEN 'byte[]'
WHEN 108 THEN 'double'
WHEN 231 THEN 'string'
WHEN 99 THEN 'string'
WHEN 239 THEN 'string'
WHEN 167 THEN 'string'
when 62 then 'decimal'
ELSE 'ukn:'+CAST(system_type_id AS NVARCHAR(10))
END + ' '+ replace(replace(replace(name, ' ','_'), '-','_'), '''','_') + ' { get; set; }'
AS CodeClass
from Sys.columns where [OBJECT_ID]=OBJECT_ID('[DRIVERSMASTER]')
No comments:
Post a Comment