Re: Decimal Data Type losing scale?
From: Aaron Weiker (aaron_at_sqlprogrammer.org)
Date: 01/31/05
- Next message: Aaron Weiker: "Re: connection string"
- Previous message: inquisite: "Bcp header"
- In reply to: Q Johnson: "Decimal Data Type losing scale?"
- Next in thread: Steve Kass: "Re: Decimal Data Type losing scale?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 31 Jan 2005 14:50:27 -0800
Hello Q,
When you run profiler what do you see the values being sent as? If you have
your precision and scale not matching exactly in your VB.NET application
it can cause it to send it incorrectly to the database.
-- Aaron Weiker http://aaronweiker.com/ http://sqlprogrammer.org/ > I'm trying to update a table that has decimal values. They are > defined at precision of 15 and scale of 2. > > When I use a T-Sql update query, I'm sending a value "with pennies", > but the > table is only reflecting the integer portion. I've even tried > UPDATE (myTableName) > SET myCost = CAST(@Cost AS decimal(15,2)) > without success. > When I step through the code of my VB.NET program and view the value > of item I've added to the parameters collection of my update query > command object, I DO SEE the pennies. When the query has executed, > they aren't in the table. I CAN TYPE the pennies into the record in > the table with Enterprise Mgr. And I can retrieve them with my > program. But I can't send new values with pennies and get them > respected in the new table values. > > I have seen in Books on Line that we are supposed to explicitly CAST > our decimal values. But shouldn't this take care of it? >
- Next message: Aaron Weiker: "Re: connection string"
- Previous message: inquisite: "Bcp header"
- In reply to: Q Johnson: "Decimal Data Type losing scale?"
- Next in thread: Steve Kass: "Re: Decimal Data Type losing scale?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|