@@ -283,6 +283,9 @@ when b.name in ('numeric', 'decimal') then '(' + cast(a.precision as varchar) +
283283,a.is_nullable 'isnullable'
284284,a.is_identity 'isidentity'
285285,f.text as 'defaultvalue'
286+ ,a.column_id as 'position'
287+ ,a.precision
288+ ,a.scale
286289from sys.columns" , loc8 . ToString ( ) . Replace ( "a.table_name" , "a.object_id" ) , @"
287290left join syscomments f on f.id = a.default_object_id
288291" ) ;
@@ -295,13 +298,15 @@ when b.name in ('numeric', 'decimal') then '(' + cast(a.precision as varchar) +
295298,cast(0 as bit) 'isnullable'
296299,a.is_output 'isidentity'
297300,'' as 'defaultvalue'
301+ ,1 as 'position'
302+ ,a.precision
303+ ,a.scale
298304from sys.parameters" , loc88 . ToString ( ) . Replace ( "a.table_name" , "a.object_id" ) , "" ) ;
299305 }
300306 sql = $ "use [{ db } ];{ sql } ;use [{ olddatabase } ]; ";
301307 ds = _orm . Ado . ExecuteArray ( CommandType . Text , sql ) ;
302308 if ( ds == null ) return loc1 ;
303309
304- var position = 0 ;
305310 foreach ( object [ ] row in ds )
306311 {
307312 var table_id = string . Concat ( row [ 0 ] ) ;
@@ -314,7 +319,10 @@ when b.name in ('numeric', 'decimal') then '(' + cast(a.precision as varchar) +
314319 var is_nullable = bool . Parse ( string . Concat ( row [ 7 ] ) ) ;
315320 var is_identity = bool . Parse ( string . Concat ( row [ 8 ] ) ) ;
316321 var defaultValue = string . Concat ( row [ 9 ] ) ;
322+ var position = int . Parse ( string . Concat ( row [ 10 ] ) ) ;
317323 if ( max_length == 0 ) max_length = - 1 ;
324+ int . TryParse ( string . Concat ( row [ 11 ] ) , out var numeric_precision ) ;
325+ int . TryParse ( string . Concat ( row [ 12 ] ) , out var numeric_scale ) ;
318326
319327 loc3 [ object_id ] . Add ( column , new DbColumnInfo
320328 {
@@ -328,7 +336,9 @@ when b.name in ('numeric', 'decimal') then '(' + cast(a.precision as varchar) +
328336 Table = loc2 [ object_id ] ,
329337 Comment = comment ,
330338 DefaultValue = defaultValue ,
331- Position = ++ position
339+ Position = position ,
340+ Precision = numeric_precision ,
341+ Scale = numeric_scale ,
332342 } ) ;
333343 loc3 [ object_id ] [ column ] . DbType = this . GetDbType ( loc3 [ object_id ] [ column ] ) ;
334344 loc3 [ object_id ] [ column ] . CsType = this . GetCsTypeInfo ( loc3 [ object_id ] [ column ] ) ;
0 commit comments