select 'public '+ case t.name when 'varchar' then 'string' when 'smallint' then 'Int16' when 'int' then 'Int32' when 'datetime' then 'DateTime' when 'numeric' then 'double' else 'string' end +' ' +cl.name+' {get;set;}', t.name, cl.max_length, cl.precision, cl.scale from sys.columns cl left join sys.types t on cl.user_type_id = t.user_type_id where object_id=OBJECT_ID('M_user') order by cl.column_id