Martjan's avatar
Martjan
Regular Visitor
1 year ago
Status:
New

Add DECIMAL_FORMAT parameter to OPENROWSET

I'd like to be able to specify the default expected number format for numeric columns (US / EU formatted decimal fields in files). When the decimal format can be passed to the openrowset statement like with date format CSV data can be import directly in the right datatypes, even when sometimes the decimal format is US and sometimes EU format (point vs comma.

 

Setting a default on session level works for the most, but in mixed cases (same within one file, but different between files), passing the right format to be expected would solve this problem. 

 

 

US Decimal Format 

Decimal Separator: Period (.)
Thousands Separator: Comma (,)
Example: $300.10 is three hundred and ten cents. 12,345.678.


EU Decimal Format 

Decimal Separator: Comma (,)
Thousands Separator: Period (.) or space ( )
Example: €300,10 is three hundred euros and ten cents. 12.345.678 or 12 345 678

No CommentsBe the first to comment

Recent ideas