Problem with Conversion of numeric data from sql table to csv


i have numeric value of data type numeric(38,12) in sql server 2000. loading csv happens is

2000--data looks 115,834,000.00 when loaded csv ---115834000--this how looks. want in database.

it of great me, if can tell me work around.

thanks,

preensheen

you number doesn't "look 115,834,000.00" in database.  it's numeric.  it's stored in binary.  it's not text.

when use ssms or query tool retrieve value, chooses format number string, , chooses use regional settings display you.

ssis typically used machine-to-machine etl transforms.  machines hate formatted numbers, because aren't wimpy humans need thousand separators understand how big number is.  (i'm wimpy human - i'm not picking on you.)  therefore, when ssis writes number text file... writes number without embellishment.

in order format - it's pleasing human eye, you're going have turn number formatted string.  unfortunately, ssis's expression language doesn't have "format" function this.  expedient way go script component.  mark numeric columns readonly, , use input/output tab create new string typed columns hold formatted output.  (or use derived column component before script create columns default values in them.)  inside script, read numeric column, apply tostring function format specification, , write string column, so:

row.stringcolumn = row.numericcolumn.tostring("###,###,##0.00")


todd mcdermid's blog talk me on


SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........