Hello,
I am trying to use a decimal type parameter in my stored procedure.
When I pass any decimal value to it (for example: 12.34), the decimal
part is always truncated off. I am left with only 12 as the value that
get put into my table. I have checked the obvious...the datatype is
decimal in the procedure. The data type for the column is decimal(9,2)
in my table. Any idea about what is going on here?Can you show some code so we can repro/diagnose?
<joey.powell@.topscene.com> wrote in message
news:1125598102.549921.46630@.g47g2000cwa.googlegroups.com...
> Hello,
> I am trying to use a decimal type parameter in my stored procedure.
> When I pass any decimal value to it (for example: 12.34), the decimal
> part is always truncated off. I am left with only 12 as the value that
> get put into my table. I have checked the obvious...the datatype is
> decimal in the procedure. The data type for the column is decimal(9,2)
> in my table. Any idea about what is going on here?
>|||joey.powell@.topscene.com wrote:
> Hello,
> I am trying to use a decimal type parameter in my stored procedure.
> When I pass any decimal value to it (for example: 12.34), the decimal
> part is always truncated off. I am left with only 12 as the value that
> get put into my table. I have checked the obvious...the datatype is
> decimal in the procedure. The data type for the column is decimal(9,2)
> in my table. Any idea about what is going on here?
You are proably using the value in a calculation that includes an
integer data type. Make sure all operations use decimal as the data
type.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Joey,
The datatype DECIMAL is shorthand for DECIMAL(18,0). Change
the data type of the procedure parameter to DECIMAL(9,2).
Steve Kass
Drew University
joey.powell@.topscene.com wrote:
>Hello,
>I am trying to use a decimal type parameter in my stored procedure.
>When I pass any decimal value to it (for example: 12.34), the decimal
>part is always truncated off. I am left with only 12 as the value that
>get put into my table. I have checked the obvious...the datatype is
>decimal in the procedure. The data type for the column is decimal(9,2)
>in my table. Any idea about what is going on here?
>
>
No comments:
Post a Comment