Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

Decimal Data Type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Partridge - 20 Jul 2008 08:42 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?

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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.