Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi All,

 

Got this issue with SQL decimals.

 

I have 3 variables:

 

decWeight as decimal

decCBM as decimal

decBox as decimal

 

Until they get inserted into the db, the IDE watch reports them as still being decimals (ex: decWeight 's value = 1200.31D as type decimal).

 

Why does SQL Server round off these values to make them integers ? (The db fields are set to decimals)

 

Thanks for any help you can provide.

Laredo512

* using VS.NET Pro 2003 *

  • *Experts*
Posted

Decimals in SQL Server have two values: precision and scale (or something like that).

 

From the help:

Precision

Shows the maximum number of digits for values of this column.

 

Scale

Shows the maximum number of digits that can appear to the right of the decimal point for values of this column.

 

My guess is that your scale is 0.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Decimals in SQL Server have two values: precision and scale (or something like that).

 

From the help:

 

 

My guess is that your scale is 0.

 

-ner

doh!

 

Ya I thought of that.... NOT

 

Thanks a bunch Nerseus, I had overlooked that "precise" detail.

Laredo512

* using VS.NET Pro 2003 *

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...