floating point - Save a float value into a char(15) variable in sql server -



floating point - Save a float value into a char(15) variable in sql server -

how can save value of float variable numfiscalactual char(15) column impfisfac

on sql server...

update factura set impfisfac= cast(@numfiscalactual varchar)

i know i've utilize char variable='char value', cast function... dunno =/

thx in advance

warning: float upto 15 important figures. little , big number, varchar(15) lose data.

0.0000123456789012345 >15 length 1.23456789012345e-05 >15 length

you seek this

update factura set impfisfac= cast(@numfiscalactual varchar(15)) where...

(you need clause otherwise every row value)

however, there issues converting floats: may find decimal places lost (i can't remember exact rules).

so, can utilize str, illustration

update factura set impfisfac= rtrim(ltrim(str(@numfiscalactual,38,16))) where...

but you'll lose info above. why? or utilize decimal fixed point types....

sql-server floating-point char

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -