How can I save the value of float variable NumFiscalActual into the char(15) column impfisfac
On sql server…
UPDATE FACTURA SET
impfisfac= cast(@NumFiscalActual AS varchar)
I know I’ve to use char variable='char value', but with this cast function… I dunno =/
Thx in advance
Warning: float is upto 15 significant figures. For very small and very large number, varchar(15) will lose data.
0.0000123456789012345is >15 lengthYou could try this
(You need the WHERE clause otherwise every row will get the value)
However, there are issues converting floats: you may find that decimal places are lost (I can’t remember exact rules).
So, you can use STR, for example
But you’ll lose data as above. So why? Or use decimal fixed point types….