Hi,
I have a sales order detail table containing a column of decimal (18,2). If
I post a value of 100.00, the value is being rounded to 100. How can I ensure
that the 00 after the decimal point is stored in the table - it would save a
whole lot of formatting within the client application?

Signature
Thanks
Bill Partridge
John Bell - 20 Jul 2008 08:56 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> a
> whole lot of formatting within the client application?
Hi
What is the issue with formatting at the front end? It is far easier more
efficient than doing it in the SQL and better than changing the datatype.
John
Bill Partridge - 20 Jul 2008 09:18 GMT
The front end contains about 60 decimal attributes (that is one table only)
in VB.NET, I didn't really want to format each one individually?

Signature
Thanks
Bill Partridge
> > Hi,
> >
[quoted text clipped - 12 lines]
>
> John
Roy Harvey (SQL Server MVP) - 20 Jul 2008 15:43 GMT
>Hi,
>
>I have a sales order detail table containing a column of decimal (18,2). If
>I post a value of 100.00, the value is being rounded to 100. How can I ensure
>that the 00 after the decimal point is stored in the table - it would save a
>whole lot of formatting within the client application?
The number is being stored precisely. It is not rounded. The
internal format of a decimal (18,2) column does not change depending
on whether there is a non-zero to the right of the decimal point.
It sounds like you are having problems with how the numbers are
displayed when retrieved. Display of a DECIMAL column is ENTIRELY in
the hands of the client program. That might be a query window in
Management Studio, or a VB .NET program, but it is entirely out of SQL
Server's control.
Roy Harvey
Beacon Falls, CT