how come that if I put in this value
tblMyTable.currency is a decimal(8,4)
insert into tblMyTable(currency) values ('0.4568')
I get this in return
.4568
or is this normal?Where are you doing this?. Depend which client application you are using to
select the data. In QA it is normal.
AMB
"Boonaap" wrote:
> how come that if I put in this value
> tblMyTable.currency is a decimal(8,4)
> insert into tblMyTable(currency) values ('0.4568')
> I get this in return
> .4568
> or is this normal?|||> or is this normal?
The formatting of data for display purposes is up to the client application.
It is normal for Query Analyzer to suppress leading zeros. Also, you should
specify a numeric literal rather than a string literal here since your
target data type is numeric. Don't enclose the value in quotes.
Hope this helps.
Dan Guzman
SQL Server MVP
"Boonaap" <Boonaap@.discussions.microsoft.com> wrote in message
news:B7B55DE1-DF3E-495F-94A1-B9DC718CEF96@.microsoft.com...
> how come that if I put in this value
> tblMyTable.currency is a decimal(8,4)
> insert into tblMyTable(currency) values ('0.4568')
> I get this in return
> .4568
> or is this normal?|||"Boonaap" <Boonaap@.discussions.microsoft.com> wrote in message
news:B7B55DE1-DF3E-495F-94A1-B9DC718CEF96@.microsoft.com...
> how come that if I put in this value
> tblMyTable.currency is a decimal(8,4)
> insert into tblMyTable(currency) values ('0.4568')
> I get this in return
> .4568
Why are you worried that you got the same number out as you put in? Were
you expecting it to be a different number? What's the problem?!
Oh, and don't enclose numeric values in quotation marks, SQL server is
having to do a typecast to convert your string into a number.
Steve
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment